Hi, Guennadi

>-----Original Message-----
>From: Guennadi Liakhovetski [mailto:g.liakhovet...@gmx.de]
>Sent: Tuesday, 05 March, 2013 18:18
>To: Albert Wang
>Cc: cor...@lwn.net; linux-media@vger.kernel.org; Libin Yang
>Subject: Re: [REVIEW PATCH V4 07/12] [media] marvell-ccic: switch to resource
>managed allocation and request
>
>Yet one more nitpick
>
>On Thu, 7 Feb 2013, Albert Wang wrote:
>
>> This patch switchs to resource managed allocation and request in mmp-driver.
>> It can remove free resource operations.
>>
>> Signed-off-by: Albert Wang <twan...@marvell.com>
>> Signed-off-by: Libin Yang <lby...@marvell.com>
>> Acked-by: Jonathan Corbet <cor...@lwn.net>
>> ---
>>  drivers/media/platform/marvell-ccic/mmp-driver.c |   65 
>> ++++++++--------------
>>  1 file changed, 22 insertions(+), 43 deletions(-)
>>
>> diff --git a/drivers/media/platform/marvell-ccic/mmp-driver.c
>b/drivers/media/platform/marvell-ccic/mmp-driver.c
>> index 818abf3..d355840 100755
>> --- a/drivers/media/platform/marvell-ccic/mmp-driver.c
>> +++ b/drivers/media/platform/marvell-ccic/mmp-driver.c
>
>[snip]
>
>> @@ -374,14 +373,12 @@ static int mmpcam_probe(struct platform_device *pdev)
>>      res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>>      if (res == NULL) {
>>              dev_err(&pdev->dev, "no iomem resource!\n");
>> -            ret = -ENODEV;
>> -            goto out_free;
>> +            return -ENODEV;
>>      }
>> -    mcam->regs = ioremap(res->start, resource_size(res));
>> +    mcam->regs = devm_request_and_ioremap(&pdev->dev, res);
>
>Don't kill me, but they've recently invented devm_ioremap_resource(),
>which is essentially the same as devm_request_and_ioremap(), but also
>returns an error code and prints an error message, so, you wouldn't have
>to invent -ENODEV yourself and you don't need the dev_err() below.
>
OK, we will investigate devm_ioremap_resource() and use it if need.


>Thanks
>Guennadi
>---
>Guennadi Liakhovetski, Ph.D.
>Freelance Open-Source Software Developer
>http://www.open-technology.de/

Thanks
Albert Wang
86-21-61092656
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to