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

soc: fsl: rcpm: Make use of the helper function devm_platform_ioremap_resource()

Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separately

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>

authored by

Cai Huoqing and committed by
Li Yang
ea411911 e0162129

+1 -6
+1 -6
drivers/soc/fsl/rcpm.c
··· 146 146 static int rcpm_probe(struct platform_device *pdev) 147 147 { 148 148 struct device *dev = &pdev->dev; 149 - struct resource *r; 150 149 struct rcpm *rcpm; 151 150 int ret; 152 151 ··· 153 154 if (!rcpm) 154 155 return -ENOMEM; 155 156 156 - r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 157 - if (!r) 158 - return -ENODEV; 159 - 160 - rcpm->ippdexpcr_base = devm_ioremap_resource(&pdev->dev, r); 157 + rcpm->ippdexpcr_base = devm_platform_ioremap_resource(pdev, 0); 161 158 if (IS_ERR(rcpm->ippdexpcr_base)) { 162 159 ret = PTR_ERR(rcpm->ippdexpcr_base); 163 160 return ret;