Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <chi.minghao@zte.com.cn>
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/202211220945587336502@zte.com.cn

authored by

Minghao Chi and committed by
Lee Jones
f359c3e5 959ecba7

+1 -3
+1 -3
drivers/mfd/stm32-lptimer.c
··· 52 52 { 53 53 struct device *dev = &pdev->dev; 54 54 struct stm32_lptimer *ddata; 55 - struct resource *res; 56 55 void __iomem *mmio; 57 56 int ret; 58 57 ··· 59 60 if (!ddata) 60 61 return -ENOMEM; 61 62 62 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 63 - mmio = devm_ioremap_resource(dev, res); 63 + mmio = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); 64 64 if (IS_ERR(mmio)) 65 65 return PTR_ERR(mmio); 66 66