Skip to content

Commit

Permalink
iio: adc: ingenic: Use devm_platform_ioremap_resource
Browse files Browse the repository at this point in the history
Replaces local boilerplate.  Identified by coccinelle.
CHECK   drivers/iio/adc/ingenic-adc.c
drivers/iio/adc/ingenic-adc.c:449:1-10: WARNING: Use devm_platform_ioremap_resource for adc -> base

Signed-off-by: Jonathan Cameron <[email protected]>
Reviewed-by: Alexandru Ardelean <[email protected]>
Cc: Artur Rojek <[email protected]>
  • Loading branch information
jic23 committed Nov 9, 2019
1 parent 46e55d0 commit f449aa3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/iio/adc/ingenic-adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,6 @@ static int ingenic_adc_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct iio_dev *iio_dev;
struct ingenic_adc *adc;
struct resource *mem_base;
const struct ingenic_adc_soc_data *soc_data;
int ret;

Expand All @@ -445,8 +444,7 @@ static int ingenic_adc_probe(struct platform_device *pdev)
mutex_init(&adc->aux_lock);
adc->soc_data = soc_data;

mem_base = platform_get_resource(pdev, IORESOURCE_MEM, 0);
adc->base = devm_ioremap_resource(dev, mem_base);
adc->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(adc->base))
return PTR_ERR(adc->base);

Expand Down

0 comments on commit f449aa3

Please sign in to comment.