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

Configure Feed

Select the types of activity you want to include in your feed.

regulator: stm32-vrefbuf: use devm_platform_ioremap_resource() to simplify code

Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20191009150138.11640-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

YueHaibing and committed by
Mark Brown
73511a90 be446f18

+1 -3
+1 -3
drivers/regulator/stm32-vrefbuf.c
··· 181 181 182 182 static int stm32_vrefbuf_probe(struct platform_device *pdev) 183 183 { 184 - struct resource *res; 185 184 struct stm32_vrefbuf *priv; 186 185 struct regulator_config config = { }; 187 186 struct regulator_dev *rdev; ··· 191 192 return -ENOMEM; 192 193 priv->dev = &pdev->dev; 193 194 194 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 195 - priv->base = devm_ioremap_resource(&pdev->dev, res); 195 + priv->base = devm_platform_ioremap_resource(pdev, 0); 196 196 if (IS_ERR(priv->base)) 197 197 return PTR_ERR(priv->base); 198 198