Skip to content

Commit f359c3e

Browse files
Minghao Chilag-linaro
authored andcommitted
mfd: stm32-lptimer: 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]> Signed-off-by: Lee Jones <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 959ecba commit f359c3e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/mfd/stm32-lptimer.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,14 @@ static int stm32_lptimer_probe(struct platform_device *pdev)
5252
{
5353
struct device *dev = &pdev->dev;
5454
struct stm32_lptimer *ddata;
55-
struct resource *res;
5655
void __iomem *mmio;
5756
int ret;
5857

5958
ddata = devm_kzalloc(dev, sizeof(*ddata), GFP_KERNEL);
6059
if (!ddata)
6160
return -ENOMEM;
6261

63-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
64-
mmio = devm_ioremap_resource(dev, res);
62+
mmio = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
6563
if (IS_ERR(mmio))
6664
return PTR_ERR(mmio);
6765

0 commit comments

Comments
 (0)