OSDN Git Service

gpiolib: do not allow to insert an empty gpiochip
authorBamvor Jian Zhang <bamvor.zhangjian@linaro.org>
Mon, 16 Nov 2015 05:02:47 +0000 (13:02 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 19 Nov 2015 08:24:40 +0000 (09:24 +0100)
commit5ed41cc4baaf4127661d2a8f8f2ee6e3085e0fa9
treecde0d7d31e4deab80a6def316ba661ef3873a0f2
parentef7c7553039b3d1c847b38b0f1ea208f8d5d8370
gpiolib: do not allow to insert an empty gpiochip

We need to check if number of gpio is positive if there is no
such check in devicetree or acpi or whatever called before
gpiochip_add.

I suppose that devicetree and acpi do not allow insert gpiochip
with zero number but I do not know if it is enough to ignore
this check in gpiochip_add.

Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib.c