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 <chi.minghao@zte.com.cn> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn> Link: https://lore.kernel.org/r/202211220947194856561@zte.com.cn Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent 55d5a86 commit e88f319

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

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)