Messages in this thread | | | Date | Tue, 27 May 2014 15:33:45 +0200 | Subject | Re: [PATCH] gpio: gpiolib: set gpiochip_remove retval to void | From | Linus Walleij <> |
| |
On Fri, May 23, 2014 at 7:03 PM, abdoulaye berthe <berthe.ab@gmail.com> wrote:
> This avoids handling gpiochip remove error in device > remove handler. > > Signed-off-by: abdoulaye berthe <berthe.ab@gmail.com>
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
| |