Skip to content

Commit a8427a7

Browse files
ndreysjic23
authored andcommitted
iio: imx7d_adc: Use devm_platform_ioremap_resource()
Use devm_platform_ioremap_resource() to be able to drop a bit of explicit boilerplate code. Signed-off-by: Andrey Smirnov <[email protected]> Cc: Jonathan Cameron <[email protected]> Cc: Hartmut Knaack <[email protected]> Cc: Lars-Peter Clausen <[email protected]> Cc: Peter Meerwald-Stadler <[email protected]> Cc: Chris Healy <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 8cc393b commit a8427a7

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/iio/adc/imx7d_adc.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,6 @@ static int imx7d_adc_probe(struct platform_device *pdev)
438438
{
439439
struct imx7d_adc *info;
440440
struct iio_dev *indio_dev;
441-
struct resource *mem;
442441
struct device *dev = &pdev->dev;
443442
int irq;
444443
int ret;
@@ -452,8 +451,7 @@ static int imx7d_adc_probe(struct platform_device *pdev)
452451
info = iio_priv(indio_dev);
453452
info->dev = dev;
454453

455-
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
456-
info->regs = devm_ioremap_resource(dev, mem);
454+
info->regs = devm_platform_ioremap_resource(pdev, 0);
457455
if (IS_ERR(info->regs)) {
458456
ret = PTR_ERR(info->regs);
459457
dev_err(dev, "Failed to remap adc memory, err = %d\n", ret);

0 commit comments

Comments
 (0)