linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio: gpio-bt8xx: fix compilation warning
@ 2014-05-14 21:43 abdoulaye berthe
  2014-05-14 21:52 ` Michael Büsch
  0 siblings, 1 reply; 3+ messages in thread
From: abdoulaye berthe @ 2014-05-14 21:43 UTC (permalink / raw)
  To: m, linus.walleij, gnurou, linux-gpio, linux-kernel, berthe.ab

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

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);
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] gpio: gpio-bt8xx: fix compilation warning
  2014-05-14 21:43 [PATCH] gpio: gpio-bt8xx: fix compilation warning abdoulaye berthe
@ 2014-05-14 21:52 ` Michael Büsch
  2014-05-16 15:51   ` Linus Walleij
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Büsch @ 2014-05-14 21:52 UTC (permalink / raw)
  To: abdoulaye berthe; +Cc: linus.walleij, gnurou, linux-gpio, linux-kernel

[-- 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 --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gpio: gpio-bt8xx: fix compilation warning
  2014-05-14 21:52 ` Michael Büsch
@ 2014-05-16 15:51   ` Linus Walleij
  0 siblings, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2014-05-16 15:51 UTC (permalink / raw)
  To: Michael Büsch
  Cc: abdoulaye berthe, Alexandre Courbot, linux-gpio@vger.kernel.org,
	linux-kernel@vger.kernel.org

On Wed, May 14, 2014 at 11:52 PM, Michael Büsch <m@bues.ch> wrote:
> 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.

Good point.

Dropping this patch in favor of real solution.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-05-16 15:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-14 21:43 [PATCH] gpio: gpio-bt8xx: fix compilation warning abdoulaye berthe
2014-05-14 21:52 ` Michael Büsch
2014-05-16 15:51   ` Linus Walleij

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).