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: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Cc: Tomer Maimon <tmaimon77@gmail.com>
This commit is contained in:
Jonathan Cameron 2019-10-13 16:44:27 +01:00
parent 18d031f46e
commit 08cf48c7fa

View File

@ -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)
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);