* [PATCH] drivers/gpio/gpio-sch311x: check return value of gpiochip_remove()
@ 2014-07-04 6:37 Varka Bhadram
2014-07-04 6:45 ` Varka Bhadram
0 siblings, 1 reply; 2+ messages in thread
From: Varka Bhadram @ 2014-07-04 6:37 UTC (permalink / raw)
To: linux-gpio; +Cc: linus.walleij, gnurou, linux-kernel, Varka Bhadram
This patch eliminates the following warning
drivers/gpio/gpio-sch311x.c: In function ‘sch311x_gpio_probe’:
drivers/gpio/gpio-sch311x.c:286:18: warning: ignoring return value of ‘gpiochip_remove’, declared with attribute warn_unused_result
Signed-off-by: Varka Bhadram <varkab@cdac.in>
---
drivers/gpio/gpio-sch311x.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-sch311x.c b/drivers/gpio/gpio-sch311x.c
index f942b80..8a4ab8f 100644
--- a/drivers/gpio/gpio-sch311x.c
+++ b/drivers/gpio/gpio-sch311x.c
@@ -232,7 +232,7 @@ static int sch311x_gpio_probe(struct platform_device *pdev)
struct sch311x_pdev_data *pdata = pdev->dev.platform_data;
struct sch311x_gpio_priv *priv;
struct sch311x_gpio_block *block;
- int err, i;
+ int err, i, ret;
/* we can register all GPIO data registers at once */
if (!request_region(pdata->runtime_reg + GP1, 6, DRV_NAME)) {
@@ -283,7 +283,11 @@ exit_err:
release_region(pdata->runtime_reg + GP1, 6);
/* release already registered chips */
for (--i; i >= 0; i--)
- gpiochip_remove(&priv->blocks[i].chip);
+ ret = gpiochip_remove(&priv->blocks[i].chip);
+
+ WARN(ret, "%s(): gpiochip_remove() failed, ret=%d\n",
+ __func__, ret);
+
return err;
}
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drivers/gpio/gpio-sch311x: check return value of gpiochip_remove()
2014-07-04 6:37 [PATCH] drivers/gpio/gpio-sch311x: check return value of gpiochip_remove() Varka Bhadram
@ 2014-07-04 6:45 ` Varka Bhadram
0 siblings, 0 replies; 2+ messages in thread
From: Varka Bhadram @ 2014-07-04 6:45 UTC (permalink / raw)
To: Varka Bhadram, linux-gpio; +Cc: linus.walleij, gnurou, linux-kernel
Hi,
Please drop this patch which generating an another warning.
I will send v2 for this.
Thanks.
On 07/04/2014 12:07 PM, Varka Bhadram wrote:
> This patch eliminates the following warning
>
> drivers/gpio/gpio-sch311x.c: In function ‘sch311x_gpio_probe’:
> drivers/gpio/gpio-sch311x.c:286:18: warning: ignoring return value of ‘gpiochip_remove’, declared with attribute warn_unused_result
>
> Signed-off-by: Varka Bhadram <varkab@cdac.in>
> ---
> drivers/gpio/gpio-sch311x.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpio/gpio-sch311x.c b/drivers/gpio/gpio-sch311x.c
> index f942b80..8a4ab8f 100644
> --- a/drivers/gpio/gpio-sch311x.c
> +++ b/drivers/gpio/gpio-sch311x.c
> @@ -232,7 +232,7 @@ static int sch311x_gpio_probe(struct platform_device *pdev)
> struct sch311x_pdev_data *pdata = pdev->dev.platform_data;
> struct sch311x_gpio_priv *priv;
> struct sch311x_gpio_block *block;
> - int err, i;
> + int err, i, ret;
>
> /* we can register all GPIO data registers at once */
> if (!request_region(pdata->runtime_reg + GP1, 6, DRV_NAME)) {
> @@ -283,7 +283,11 @@ exit_err:
> release_region(pdata->runtime_reg + GP1, 6);
> /* release already registered chips */
> for (--i; i >= 0; i--)
> - gpiochip_remove(&priv->blocks[i].chip);
> + ret = gpiochip_remove(&priv->blocks[i].chip);
> +
> + WARN(ret, "%s(): gpiochip_remove() failed, ret=%d\n",
> + __func__, ret);
> +
> return err;
> }
>
--
Cheers,
Varka Bhadram.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-07-04 6:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-04 6:37 [PATCH] drivers/gpio/gpio-sch311x: check return value of gpiochip_remove() Varka Bhadram
2014-07-04 6:45 ` Varka Bhadram
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).