From: "Rakib Mullick" <rakib.mullick@gmail.com>
To: "Michael Buesch" <mb@bu3sch.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drivers/gpio/bt8xxgpio.c Fix compilation warning.
Date: Thu, 2 Oct 2008 19:39:06 +0600 [thread overview]
Message-ID: <b9df5fa10810020639k1538eb68rd2883f68f4224087@mail.gmail.com> (raw)
In-Reply-To: <200810021022.13252.mb@bu3sch.de>
On 10/2/08, Michael Buesch <mb@bu3sch.de> wrote:
> On Thursday 02 October 2008 08:59:11 Rakib Mullick wrote:
> > drivers/gpio/bt8xxgpio.c: In function `bt8xxgpio_remove':
> > drivers/gpio/bt8xxgpio.c:247: warning: ignoring return value of
> > `gpiochip_remove', declared with attribute warn_unused_result
> >
> > Following patch removes the above warning.
> > Thanks.
> >
> > Signed-off-by: Md.Rakib H. Mullick (rakib.mullick@gmail.com)
> >
> > --- linux-2.6.27-rc8.orig/drivers/gpio/bt8xxgpio.c 2008-10-01
> > 19:20:59.000000000 +0600
> > +++ linux-2.6.27-rc8/drivers/gpio/bt8xxgpio.c 2008-10-02
> > 12:30:26.374544032 +0600
> > @@ -242,9 +242,14 @@ err_freebg:
> >
> > static void bt8xxgpio_remove(struct pci_dev *pdev)
> > {
> > + int err;
> > struct bt8xxgpio *bg = pci_get_drvdata(pdev);
> >
> > - gpiochip_remove(&bg->gpio);
> > + err = gpiochip_remove(&bg->gpio);
> > + if (err) {
> > + printk(KERN_ERR "bt8xxgpio: Resource busy. Failed to remove.\n");
> > + return ;
> > + }
> >
> > bgwrite(0, BT848_INT_MASK);
> > bgwrite(~0x0, BT848_INT_STAT);
> >
> >
>
>
> NACK.
> gpiolib should be fixed.
> It is impossible to handle this case. What your patch does is to leave the device
> in an inconsistent state, if the gpio remove fails.
Yes, but it will notice through KERN_ERR that something bad has
happened. And if we don't get out of it then it will continue its
execution and will finish with a kfree ( I think which
is bad ). Am I missing anything ?
>
> gpiolib is broken. It should not allow failure for the remove function, as most
> callers cannot handle it. gpiolib should force-remove any users of the gpio line,
> if the chip driver removes the chip. That's really the only way we can fix this.
> Breaking the driver (to leak resources or leave the device in an inconsistent state)
> just to get rid of a bogus warning is not the right fix.
> Please ignore this warning for now.
>
>
> --
> Greetings Michael.
>
prev parent reply other threads:[~2008-10-02 13:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-02 6:59 Rakib Mullick
2008-10-02 8:22 ` Michael Buesch
2008-10-02 13:39 ` Rakib Mullick [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b9df5fa10810020639k1538eb68rd2883f68f4224087@mail.gmail.com \
--to=rakib.mullick@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mb@bu3sch.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®