lkml.org 
[lkml]   [2014]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] gpio: gpiolib: set gpiochip_remove retval to void
From
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


\
 
 \ /
  Last update: 2014-05-27 16:21    [W:0.054 / U:0.812 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site