lkml.org 
[lkml]   [2013]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 10/27] drivers/memory: don't check resource with devm_ioremap_resource
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.


\
 
 \ /
  Last update: 2013-07-24 04:01    [W:0.411 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site