linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Hesselbarth <sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: delicious quinoa
	<delicious.quinoa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Fabio Estevam <festevam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-kernel
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Linus Walleij
	<linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>,
	"linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Grant Likely
	<grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>,
	Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
	Steffen Trumtrar
	<s.trumtrar-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
	Jamie Iles <jamie-wmLquQDDieKakBO8gow8eQ@public.gmane.org>,
	Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>,
	Alan Tull <atull-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org>,
	Dinh Nguyen <dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org>,
	Yves Vandervennet
	<rocket.yvanderv-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH 1/1] gpio: add a driver for the Synopsys DesignWare APB GPIO block
Date: Thu, 07 Nov 2013 00:29:17 +0100	[thread overview]
Message-ID: <527AD0CD.8020001@gmail.com> (raw)
In-Reply-To: <CANk1AXTys8B-jW0bATu19pOauVqe=aMc7v=SxXPm7npWb2y7eA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On 11/07/2013 12:18 AM, delicious quinoa wrote:
> On Wed, Nov 6, 2013 at 5:09 PM, Fabio Estevam <festevam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> On Wed, Nov 6, 2013 at 8:49 PM, Alan Tull <delicious.quinoa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>
>>> +
>>> +       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>>> +       gpio->regs = devm_ioremap_resource(&pdev->dev, res);
>>> +       if (!gpio->regs) {
>>> +               err = -ENOMEM;
>>> +               goto out_free_ports;
>>
>> The correct way to handle the error here would be:
>>
>> if (IS_ERR(gpio->regs) {
>>       err = PTR_ERR(gpio->regs)
>>       goto out_free_ports;
>>
>>
>>> +out_unregister:
>>> +       dwapb_gpio_unregister(gpio);
>>> +
>>> +       if (gpio->domain) {
>>> +               irq_dispose_mapping(gpio->hwirq);
>>> +               irq_domain_remove(gpio->domain);
>>> +       }
>>> +
>>> +out_free_ports:
>>> +       devm_kfree(&pdev->dev, gpio->ports);
>>
>> No need to call devm_kfree
>>
>>> +
>>> +out_err:
>>> +       devm_kfree(&pdev->dev, gpio);
>>
>> Same here.
>>
>>> +       return err;
>>> +}
>>> +
>>> +static int dwapb_gpio_remove(struct platform_device *pdev)
>>> +{
>>> +       struct dwapb_gpio *gpio = platform_get_drvdata(pdev);
>>> +
>>> +       dwapb_gpio_unregister(gpio);
>>> +       if (gpio->domain) {
>>> +               irq_dispose_mapping(gpio->hwirq);
>>> +               irq_domain_remove(gpio->domain);
>>> +       }
>>> +       devm_kfree(&pdev->dev, gpio->ports);
>>> +       devm_kfree(&pdev->dev, gpio);
>>
>> No need to call devm_kfree
>>
>> Regards,
>>
>> Fabio Estevam
>
> Cool, I agree.  I will fix in v7.

Alan, will review tomorrow. Please do not send v7 too quickly,
but let it idle for some more days. Especially, DT maintainers
have so many reviews to do - so be patient.

Also, for v7, you should use
'git format-patch --subject-prefix "PATCH v7" ...' to reflect
the patch version in email subject line.

Sebastian

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2013-11-06 23:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-06 22:49 [PATCH 0/1] gpio: add a driver for the Synopsys DesignWare APB GPIO Alan Tull
2013-11-06 22:49 ` [PATCH 1/1] gpio: add a driver for the Synopsys DesignWare APB GPIO block Alan Tull
2013-11-06 23:09   ` Fabio Estevam
2013-11-06 23:18     ` delicious quinoa
     [not found]       ` <CANk1AXTys8B-jW0bATu19pOauVqe=aMc7v=SxXPm7npWb2y7eA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-11-06 23:29         ` Sebastian Hesselbarth [this message]
2013-11-06 23:34   ` Jamie Iles
2013-11-06 23:44     ` Sebastian Hesselbarth
2013-11-07 21:06       ` delicious quinoa
2013-11-07 12:33   ` Sebastian Hesselbarth
2013-11-20 21:47     ` delicious quinoa
2013-11-20 23:40       ` Rob Herring
2013-11-20 23:46         ` Sebastian Hesselbarth

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=527AD0CD.8020001@gmail.com \
    --to=sebastian.hesselbarth-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=atull-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org \
    --cc=delicious.quinoa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=dinguyen-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org \
    --cc=festevam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
    --cc=heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org \
    --cc=jamie-wmLquQDDieKakBO8gow8eQ@public.gmane.org \
    --cc=linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org \
    --cc=linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
    --cc=rocket.yvanderv-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=s.trumtrar-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    /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).