Commit 08cf48c7 authored by Jonathan Cameron's avatar Jonathan Cameron

iio: adc: npcm: use devm_platform_ioremap_resource

Reduces local boilerplate code.
Suggested by coccinelle via coccicheck.

CHECK   drivers/iio/adc/npcm_adc.c
drivers/iio/adc/npcm_adc.c:200:1-11: WARNING: Use devm_platform_ioremap_resource for info -> regs
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: default avatarAlexandru Ardelean <alexandru.ardelean@analog.com>
Cc: Tomer Maimon <tmaimon77@gmail.com>
parent 18d031f4
...@@ -183,7 +183,6 @@ static int npcm_adc_probe(struct platform_device *pdev) ...@@ -183,7 +183,6 @@ static int npcm_adc_probe(struct platform_device *pdev)
int irq; int irq;
u32 div; u32 div;
u32 reg_con; u32 reg_con;
struct resource *res;
struct npcm_adc *info; struct npcm_adc *info;
struct iio_dev *indio_dev; struct iio_dev *indio_dev;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
...@@ -196,8 +195,7 @@ static int npcm_adc_probe(struct platform_device *pdev) ...@@ -196,8 +195,7 @@ static int npcm_adc_probe(struct platform_device *pdev)
info->dev = &pdev->dev; info->dev = &pdev->dev;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); info->regs = devm_platform_ioremap_resource(pdev, 0);
info->regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(info->regs)) if (IS_ERR(info->regs))
return PTR_ERR(info->regs); return PTR_ERR(info->regs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment