Re: [PATCH 2/5] drivers: bus: omap_l3: Convert to use devm_request_and_ioremap()

From: Peter Ujfalusi
Date: Tue Mar 04 2014 - 04:43:36 EST


On 03/04/2014 11:12 AM, Alexander Shiyan wrote:
> ÐÑÐÑÐÐÐ, 4 ÐÐÑÑÐ 2014, 11:01 +02:00 ÐÑ Peter Ujfalusi <peter.ujfalusi@xxxxxx>:
>> We can then remove the iounmap() calls from probe and remove.
>> Since the driver requests the resources via index we can do the mem resource
>> request within a for loop.
>>
>> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@xxxxxx>
>> Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti>
>> ---
>
>> + /* Get mem resources */
>> + for (i = 0; i < 3; i++) {
>> + struct resource *res = platform_get_resource(pdev,
>> + IORESOURCE_MEM, i);
>> + if (!res) {
>> + dev_err(&pdev->dev, "couldn't find resource %d\n", i);
>> + return -ENODEV;
>> + }
>
> No need to check "res". devm_request_and_ioremap() do all for us.

True.

--
PÃter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/