Re: [PATCH] gpio: gpiolib: set gpiochip_remove retval to void

From: Linus Walleij
Date: Tue May 27 2014 - 09:33:53 EST


On Fri, May 23, 2014 at 7:03 PM, abdoulaye berthe <berthe.ab@xxxxxxxxx> wrote:

> This avoids handling gpiochip remove error in device
> remove handler.
>
> Signed-off-by: abdoulaye berthe <berthe.ab@xxxxxxxxx>

In general this is the right thing to do.

> for (id = 0; id < chip->ngpio; id++) {
> - if (test_bit(FLAG_REQUESTED, &chip->desc[id].flags)) {
> - status = -EBUSY;
> - break;
> - }
> - }
> - if (status == 0) {
> - for (id = 0; id < chip->ngpio; id++)
> - chip->desc[id].chip = NULL;
> -
> - list_del(&chip->list);
> + if (test_bit(FLAG_REQUESTED, &chip->desc[id].flags))
> + panic("gpiolib.c: gpiochip is still requested\n");

panic("gpio: removing gpiochip with gpios still requested\");
is more helpful.

But I want a patch that also removes *ALL* users of the return value
from this function in the *same* patch to avoid bisectability issues.

$ git grep gpiochip_remove

Then fix all of them or use coccinelle.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/