linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael Büsch" <m@bues.ch>
To: abdoulaye berthe <berthe.ab@gmail.com>
Cc: linus.walleij@linaro.org, gnurou@gmail.com,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] gpio: gpio-bt8xx: fix compilation warning
Date: Wed, 14 May 2014 23:52:32 +0200	[thread overview]
Message-ID: <20140514235232.57bbc9df@wiggum> (raw)
In-Reply-To: <1400103816-26086-1-git-send-email-berthe.ab@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1313 bytes --]

On Wed, 14 May 2014 23:43:36 +0200
abdoulaye berthe <berthe.ab@gmail.com> wrote:

> this fixes a compilation warning by checking
> the retun value of gpiochip_remove()


Really, I would rather change the gpiochip_remove return type to void.

What is the point of printing a useless error message in case
of a failure and then continuing as always.
This is not fixing a compiler warning, it is a workaround. And a bad one, indeed.

How are we supposed to handle a gpiochip_remove failure correctly
in a pcidev remove handler?


> Signed-off-by: abdoulaye berthe <berthe.ab@gmail.com>
> ---
>  drivers/gpio/gpio-bt8xx.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpio/gpio-bt8xx.c b/drivers/gpio/gpio-bt8xx.c
> index ecb3ca2d..5480229 100644
> --- a/drivers/gpio/gpio-bt8xx.c
> +++ b/drivers/gpio/gpio-bt8xx.c
> @@ -240,7 +240,8 @@ static void bt8xxgpio_remove(struct pci_dev *pdev)
>  {
>  	struct bt8xxgpio *bg = pci_get_drvdata(pdev);
>  
> -	gpiochip_remove(&bg->gpio);
> +	if (gpiochip_remove(&bg->gpio))
> +		dev_info(&pdev->dev, "gpiochip_remove() failed.\n");
>  
>  	bgwrite(0, BT848_INT_MASK);
>  	bgwrite(~0x0, BT848_INT_STAT);




-- 
Michael.

----
Please use PGP/GPG encryption.
Key-ID: F532BE1D908D8B0E
--------

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2014-05-14 22:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-14 21:43 [PATCH] gpio: gpio-bt8xx: fix compilation warning abdoulaye berthe
2014-05-14 21:52 ` Michael Büsch [this message]
2014-05-16 15:51   ` Linus Walleij

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=20140514235232.57bbc9df@wiggum \
    --to=m@bues.ch \
    --cc=berthe.ab@gmail.com \
    --cc=gnurou@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).