Skip to content

Commit

Permalink
iio: adc: vf610: use devm_platform_ioremap_resource
Browse files Browse the repository at this point in the history
Reduces boilerplate.

Suggested by coccinelle
CHECK   drivers/iio/adc/vf610_adc.c
drivers/iio/adc/vf610_adc.c:819:1-11: WARNING: Use devm_platform_ioremap_resource for info -> regs

Signed-off-by: Jonathan Cameron <[email protected]>
Reviewed-by: Alexandru Ardelean <[email protected]>
Cc: Fugang Duan <[email protected]>
  • Loading branch information
jic23 committed Nov 9, 2019
1 parent e8ad786 commit afac22e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/iio/adc/vf610_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,6 @@ static int vf610_adc_probe(struct platform_device *pdev)
{
struct vf610_adc *info;
struct iio_dev *indio_dev;
struct resource *mem;
int irq;
int ret;

Expand All @@ -815,8 +814,7 @@ static int vf610_adc_probe(struct platform_device *pdev)
info = iio_priv(indio_dev);
info->dev = &pdev->dev;

mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
info->regs = devm_ioremap_resource(&pdev->dev, mem);
info->regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(info->regs))
return PTR_ERR(info->regs);

Expand Down

0 comments on commit afac22e

Please sign in to comment.