From: Samuel Ortiz <sameo@linux.intel.com>
To: Denis Turischev <denis@compulab.co.il>
Cc: linux-kernel@vger.kernel.org,
Stephen Rothwell <sfr@canb.auug.org.au>,
linux-next@vger.kernel.org, Mike Rapoport <mike@compulab.co.il>
Subject: Re: sch_gpio: fix compilation warning "ignoring return value of gpiochip_remove"
Date: Fri, 5 Mar 2010 19:11:17 +0100 [thread overview]
Message-ID: <20100305181117.GA5615@sortiz.org> (raw)
In-Reply-To: <4B8E2CE9.3050001@compulab.co.il>
Hi Denis,
On Wed, Mar 03, 2010 at 11:33:29AM +0200, Denis Turischev wrote:
> Signed-off-by: Denis Turischev <denis@compulab.co.il>
I modified this patch as you were leaking some resources releasing.
Cheers,
Samuel.
> ---
> drivers/gpio/sch_gpio.c | 25 +++++++++++++++++++++----
> 1 files changed, 21 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpio/sch_gpio.c b/drivers/gpio/sch_gpio.c
> index 761071a..a89c02d 100644
> --- a/drivers/gpio/sch_gpio.c
> +++ b/drivers/gpio/sch_gpio.c
> @@ -229,7 +229,12 @@ static int __devinit sch_gpio_probe(struct platform_device *pdev)
> return 0;
>
> err_sch_gpio_resume:
> - gpiochip_remove(&sch_gpio_core);
> + err = gpiochip_remove(&sch_gpio_core);
> + if (err) {
> + dev_err(&pdev->dev, "%s failed, %d\n",
> + "gpiochip_remove()", err);
> + return err;
> + }
>
> err_sch_gpio_core:
> release_region(res->start, resource_size(res));
> @@ -240,11 +245,23 @@ err_sch_gpio_core:
>
> static int __devexit sch_gpio_remove(struct platform_device *pdev)
> {
> + int err_c, err_r;
> struct resource *res;
> if (gpio_ba) {
> - gpiochip_remove(&sch_gpio_core);
> - gpiochip_remove(&sch_gpio_resume);
> -
> + err_c = gpiochip_remove(&sch_gpio_core);
> +
> + err_r = gpiochip_remove(&sch_gpio_resume);
> +
> + if (err_c) {
> + dev_err(&pdev->dev, "%s failed, %d\n",
> + "gpiochip_remove()", err_c);
> + return err_c;
> + }
> + if (err_r) {
> + dev_err(&pdev->dev, "%s failed, %d\n",
> + "gpiochip_remove()", err_r);
> + return err_r;
> + }
> res = platform_get_resource(pdev, IORESOURCE_IO, 0);
>
> release_region(res->start, resource_size(res));
> --
> 1.6.3.3
>
--
Intel Open Source Technology Centre
http://oss.intel.com/
prev parent reply other threads:[~2010-03-05 18:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-03 5:22 linux-next: build warning after merge of the mfd tree Stephen Rothwell
2010-03-03 9:33 ` sch_gpio: fix compilation warning "ignoring return value of gpiochip_remove" Denis Turischev
2010-03-05 18:11 ` Samuel Ortiz [this message]
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=20100305181117.GA5615@sortiz.org \
--to=sameo@linux.intel.com \
--cc=denis@compulab.co.il \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=mike@compulab.co.il \
--cc=sfr@canb.auug.org.au \
/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).