iio: adc: npcm: use devm_platform_ioremap_resource
Subsystems (2)
[email protected]
maintainerPATCH 1/1 iio: adc: npcm: use devm_platform_ioremap_resource
From: Jonathan Cameron <[email protected]>
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
--- drivers/iio/adc/npcm_adc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iio/adc/npcm_adc.c +1 -3
@@ -183,7 +183,6 @@ static int npcm_adc_probe(struct platform_device *pdev)int irq;u32 div;u32 reg_con; -struct resource *res;struct npcm_adc *info;struct iio_dev *indio_dev;struct device *dev = &pdev->dev;
@@ -196,8 +195,7 @@ static int npcm_adc_probe(struct platform_device *pdev) info->dev = &pdev->dev; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - info->regs =devm_ioremap_resource (&pdev->dev, res); + info->regs =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (info->regs))return PTR_ERR (info->regs);
Signature · 1 line
2.23.0
Quoted 9 lines · On Sun, 2019-10-13 at 16:44 +0100, [email protected] wrote:
From: Jonathan Cameron <[email protected]>
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: Usedevm_platform_ioremap_resourcefor info -> regs
Quoted 30 lines
Signed-off-by Jonathan Cameron <[email protected]>Cc Tomer Maimon <[email protected]>--- drivers/iio/adc/npcm_adc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/iio/adc/npcm_adc.c +0
-1@@ -183,7 +183,6 @@ static int npcm_adc_probe(struct platform_device *pdev)int irq;u32 div;u32 reg_con; -struct resource *res;struct npcm_adc *info;struct iio_dev *indio_dev;drivers/iio/adc/npcm_adc.c +1
-2struct device *dev = &pdev->dev;@@ -196,8 +195,7 @@ static int npcm_adc_probe(struct platform_device *pdev) info->dev = &pdev->dev; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - info->regs =devm_ioremap_resource (&pdev->dev, res); + info->regs =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (info->regs))return PTR_ERR (info->regs);
Quoted 6 lines · Alexandru
Quoted 5 lines · On Sun, 2019-10-13 at 16:44 +0100, [email protected] wrote:
From: Jonathan Cameron <[email protected]>
Reduces local boilerplate code.
Suggested by coccinelle via coccicheck.
Quoted 6 lines
Quoted 4 lines
CHECK
drivers/iio/adc/npcm_adc.c
drivers/iio/adc/npcm_adc.c:200:1-11: WARNING: Usedevm_platform_ioremap_resourcefor info -> regsReviewed-by Alexandru Ardelean <[email protected]>
Applied,
Thanks,
Jonathan
Quoted 31 lines
Quoted 31 lines
Signed-off-by Jonathan Cameron <[email protected]>Cc Tomer Maimon <[email protected]>--- drivers/iio/adc/npcm_adc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/iio/adc/npcm_adc.c +0
-1@@ -183,7 +183,6 @@ static int npcm_adc_probe(struct platform_device *pdev)int irq;u32 div;u32 reg_con; -struct resource *res;struct npcm_adc *info;struct iio_dev *indio_dev;drivers/iio/adc/npcm_adc.c +1
-2struct device *dev = &pdev->dev;@@ -196,8 +195,7 @@ static int npcm_adc_probe(struct platform_device *pdev) info->dev = &pdev->dev; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - info->regs =devm_ioremap_resource (&pdev->dev, res); + info->regs =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (info->regs))return PTR_ERR (info->regs);