From: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
To: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
Cc: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 10/27] drivers/memory: don't check resource with devm_ioremap_resource
Date: Tue, 23 Jul 2013 18:27:57 -0700 [thread overview]
Message-ID: <51EF2D9D.8030904@wwwdotorg.org> (raw)
In-Reply-To: <1374603925.3387.26.camel@joe-AO722>
On 07/23/2013 11:25 AM, Joe Perches wrote:
> On Tue, 2013-07-23 at 20:01 +0200, Wolfram Sang wrote:
>> devm_ioremap_resource does sanity checks on the given resource. No need to
>> duplicate this in the driver.
>
> Hi Wolfram:
>
> This is the first and only one of the patch series I looked at.
>
>> diff --git a/drivers/memory/tegra20-mc.c b/drivers/memory/tegra20-mc.c
> []
>> @@ -218,8 +218,6 @@ static int tegra20_mc_probe(struct platform_device *pdev)
>> struct resource *res;
>>
>> res = platform_get_resource(pdev, IORESOURCE_MEM, i);
>> - if (!res)
>> - return -ENODEV;
>> mc->regs[i] = devm_ioremap_resource(&pdev->dev, res);
>
> I'm not so sure this is appropriate.
>
> devm_ioremap_resource returns ERR_PTR(-EINVAL) for
> null resource so this changes the return.
I think the exact return value is probably pretty arbitrary here.
> devm_ioremap_resource also emits a noisy dev_err
> message when resource is NULL.
>
> It's a probe and before the message log would be silent
> but now there's a new dmesg.
I think those changes are fine, at least for this driver. It's a bug if
the required resources are missing, and having probe() actively point
out why it's failing can only be a good thing in my book.
next prev parent reply other threads:[~2013-07-24 1:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-23 18:01 [PATCH 00/27] devm cleanup, part #1, take #3 Wolfram Sang
2013-07-23 18:01 ` [PATCH 02/27] drivers/amba: don't check resource with devm_ioremap_resource Wolfram Sang
[not found] ` <1374602524-3398-3-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
2013-07-24 1:34 ` Stephen Warren
2013-07-23 18:01 ` [PATCH 05/27] drivers/gpu/host1x/drm: " Wolfram Sang
[not found] ` <1374602524-3398-6-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
2013-08-01 10:20 ` Terje Bergström
2013-07-23 18:01 ` [PATCH 08/27] drivers/iommu: " Wolfram Sang
[not found] ` <1374602524-3398-9-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
2013-07-24 1:30 ` Stephen Warren
2013-07-23 18:01 ` [PATCH 10/27] drivers/memory: " Wolfram Sang
[not found] ` <1374602524-3398-11-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
2013-07-23 18:25 ` Joe Perches
2013-07-24 1:27 ` Stephen Warren [this message]
[not found] ` <51EF2D9D.8030904-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-07-24 1:38 ` Joe Perches
2013-07-24 1:32 ` Stephen Warren
2013-07-23 18:01 ` [PATCH 25/27] sound/soc/tegra: " Wolfram Sang
2013-07-24 14:37 ` Mark Brown
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=51EF2D9D.8030904@wwwdotorg.org \
--to=swarren-3lzwwm7+weoh9zmkesr00q@public.gmane.org \
--cc=joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=wsa-z923LK4zBo2bacvFa/9K2g@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