Skip to content

Commit e88f319

Browse files
Minghao Chialexandrebelloni
authored andcommitted
rtc: ds1742: use devm_platform_get_and_ioremap_resource()
Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Minghao Chi <[email protected]> Signed-off-by: ye xingchen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent 55d5a86 commit e88f319

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/rtc/rtc-ds1742.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,7 @@ static int ds1742_rtc_probe(struct platform_device *pdev)
158158
if (!pdata)
159159
return -ENOMEM;
160160

161-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
162-
ioaddr = devm_ioremap_resource(&pdev->dev, res);
161+
ioaddr = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
163162
if (IS_ERR(ioaddr))
164163
return PTR_ERR(ioaddr);
165164

0 commit comments

Comments
 (0)