From: Andreas Larsson <andreas@gaisler.com>
To: Anton Vorontsov <anton@enomsg.org>
Cc: Grant Likely <grant.likely@secretlab.ca>,
Linus Walleij <linus.walleij@linaro.org>,
Rob Herring <rob.herring@calxeda.com>,
linux-kernel@vger.kernel.org,
devicetree-discuss@lists.ozlabs.org, software@gaisler.com
Subject: Re: [PATCH v3] gpio: Add device driver for GRGPIO cores and support custom accessors with gpio-generic
Date: Wed, 13 Feb 2013 15:13:53 +0100 [thread overview]
Message-ID: <511B9FA1.1090602@gaisler.com> (raw)
In-Reply-To: <20130213070550.GA17523@lizard.gateway.2wire.net>
On 2013-02-13 08:05, Anton Vorontsov wrote:
> On Tue, Feb 12, 2013 at 08:24:33AM +0100, Andreas Larsson wrote:
>> + res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
>> + regs = devm_request_and_ioremap(&ofdev->dev, res);
>
> Just wonder, is it safe to pass null res to devm_request_and_ioremap()?
Yes, and it is the preferred sequence of calls according to the
documentation of devm_request_and_ioremap.
>> + label = kstrdup(np->full_name, GFP_KERNEL);
>> + if (label)
>> + gc->label = label;
>
> Do we need to free label? If not, having a comment would be awesome. :)
> And should we print a warning for !label case?
Yes, it needs to be freed, thanks! The !label case is kind of OK as the
gpio system assigns some other label if it is NULL, but I'll require it
instead to make things easier.
>> +static int grgpio_remove(struct platform_device *ofdev)
>> +{
>> + dev_set_drvdata(&ofdev->dev, NULL);
>
> Is this really needed?
I guess not.
Thanks for the feedback! I take care of the other comments as well.
Cheers,
Andreas Larsson
next prev parent reply other threads:[~2013-02-13 14:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-12 7:24 [PATCH v3] gpio: Add device driver for GRGPIO cores and support custom accessors with gpio-generic Andreas Larsson
2013-02-13 7:05 ` Anton Vorontsov
2013-02-13 14:13 ` Andreas Larsson [this message]
[not found] ` <1360653873-25368-1-git-send-email-andreas-FkzTOoA/JUlBDgjK7y7TUQ@public.gmane.org>
2013-03-01 0:24 ` Linus Walleij
[not found] ` <CACRpkdaYQSrzm_Yj3ZH9YZLC_zPJN06X-9ZM9jd7=X0OB1shXQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-03-02 20:13 ` Grant Likely
2013-03-04 9:46 ` Andreas Larsson
2013-03-07 3:44 ` Linus Walleij
2013-03-08 9:00 ` Andreas Larsson
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=511B9FA1.1090602@gaisler.com \
--to=andreas@gaisler.com \
--cc=anton@enomsg.org \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rob.herring@calxeda.com \
--cc=software@gaisler.com \
/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).