[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <511B9FA1.1090602@gaisler.com>
Date: Wed, 13 Feb 2013 15:13:53 +0100
From: Andreas Larsson <andreas@...sler.com>
To: Anton Vorontsov <anton@...msg.org>
CC: Grant Likely <grant.likely@...retlab.ca>,
Linus Walleij <linus.walleij@...aro.org>,
Rob Herring <rob.herring@...xeda.com>,
linux-kernel@...r.kernel.org, devicetree-discuss@...ts.ozlabs.org,
software@...sler.com
Subject: Re: [PATCH v3] gpio: Add device driver for GRGPIO cores and support
custom accessors with gpio-generic
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists