linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] drivers/gpio/gpio-sch311x: check return value of gpiochip_remove()
@ 2014-07-04  7:02 Varka Bhadram
  2014-07-06  9:22 ` Alexandre Courbot
  0 siblings, 1 reply; 4+ messages in thread
From: Varka Bhadram @ 2014-07-04  7:02 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 |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-sch311x.c b/drivers/gpio/gpio-sch311x.c
index f942b80..74282b9 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 = 0;
 
 	/* we can register all GPIO data registers at once */
 	if (!request_region(pdata->runtime_reg + GP1, 6, DRV_NAME)) {
@@ -282,8 +282,13 @@ static int sch311x_gpio_probe(struct platform_device *pdev)
 exit_err:
 	release_region(pdata->runtime_reg + GP1, 6);
 	/* release already registered chips */
-	for (--i; i >= 0; i--)
-		gpiochip_remove(&priv->blocks[i].chip);
+	for (--i; i >= 0; i--) {
+		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] 4+ messages in thread

* Re: [PATCH v2] drivers/gpio/gpio-sch311x: check return value of gpiochip_remove()
  2014-07-04  7:02 [PATCH v2] drivers/gpio/gpio-sch311x: check return value of gpiochip_remove() Varka Bhadram
@ 2014-07-06  9:22 ` Alexandre Courbot
  2014-07-06 13:23   ` Varka Bhadram
  0 siblings, 1 reply; 4+ messages in thread
From: Alexandre Courbot @ 2014-07-06  9:22 UTC (permalink / raw)
  To: Varka Bhadram
  Cc: linux-gpio@vger.kernel.org, Linus Walleij,
	Linux Kernel Mailing List, Varka Bhadram

On Fri, Jul 4, 2014 at 4:02 PM, Varka Bhadram <varkabhadram@gmail.com> 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

gpiochip_remove() is to have its return value set to void in another
patch, so I'm not sure we need this one in the meantime?
--
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	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] drivers/gpio/gpio-sch311x: check return value of gpiochip_remove()
  2014-07-06  9:22 ` Alexandre Courbot
@ 2014-07-06 13:23   ` Varka Bhadram
  2014-07-09  7:50     ` Linus Walleij
  0 siblings, 1 reply; 4+ messages in thread
From: Varka Bhadram @ 2014-07-06 13:23 UTC (permalink / raw)
  To: Alexandre Courbot
  Cc: linux-gpio@vger.kernel.org, Linus Walleij,
	Linux Kernel Mailing List, Varka Bhadram

Hi,

On Sunday 06 July 2014 02:52 PM, Alexandre Courbot wrote:
> On Fri, Jul 4, 2014 at 4:02 PM, Varka Bhadram <varkabhadram@gmail.com> 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
> gpiochip_remove() is to have its return value set to void in another
> patch, so I'm not sure we need this one in the meantime?

I also saw that patch from abdoulaye berthe<berthe.ab@gmail.com>  .

If that is accepted its good. If not this may require.

-- 
Regards,
Varka Bhadram

--
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	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] drivers/gpio/gpio-sch311x: check return value of gpiochip_remove()
  2014-07-06 13:23   ` Varka Bhadram
@ 2014-07-09  7:50     ` Linus Walleij
  0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2014-07-09  7:50 UTC (permalink / raw)
  To: Varka Bhadram
  Cc: Alexandre Courbot, linux-gpio@vger.kernel.org,
	Linux Kernel Mailing List, Varka Bhadram

On Sun, Jul 6, 2014 at 3:23 PM, Varka Bhadram <varkabhadram@gmail.com> wrote:
> On Sunday 06 July 2014 02:52 PM, Alexandre Courbot wrote:
>> On Fri, Jul 4, 2014 at 4:02 PM, Varka Bhadram <varkabhadram@gmail.com>
>> 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
>>
>> gpiochip_remove() is to have its return value set to void in another
>> patch, so I'm not sure we need this one in the meantime?
>
>
> I also saw that patch from abdoulaye berthe<berthe.ab@gmail.com>  .
>
> If that is accepted its good. If not this may require.

Yeah I'll go remove that. Just working out the patch mechanics right now,
we'll probably remove all return value checks in v3.17 and then delete
the code in gpiolib in late v3.17 cycle or the next merge window.

Yours,
Linus Walleij

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

end of thread, other threads:[~2014-07-09  7:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-04  7:02 [PATCH v2] drivers/gpio/gpio-sch311x: check return value of gpiochip_remove() Varka Bhadram
2014-07-06  9:22 ` Alexandre Courbot
2014-07-06 13:23   ` Varka Bhadram
2014-07-09  7:50     ` 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).