Re: [PATCH] gpio: gpio-bt8xx: fix compilation warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 14 May 2014 23:43:36 +0200
abdoulaye berthe <berthe.ab@xxxxxxxxx> 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@xxxxxxxxx>
> ---
>  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: signature.asc
Description: PGP signature


[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux