On Wed, Jun 21, 2017 at 10:45 AM, Fabio Estevam <fabio.estevam@xxxxxxx> wrote: > By using devm_ioremap_resource() the code can be simplified, as we > no longer need to check whether platform_get_resource() succeeded > or not, as this check is already performed in devm_ioremap_resource(). > > Signed-off-by: Fabio Estevam <fabio.estevam@xxxxxxx> > --- > drivers/iio/adc/mxs-lradc-adc.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git a/drivers/iio/adc/mxs-lradc-adc.c b/drivers/iio/adc/mxs-lradc-adc.c > index 6888167..2faf65f 100644 > --- a/drivers/iio/adc/mxs-lradc-adc.c > +++ b/drivers/iio/adc/mxs-lradc-adc.c > @@ -718,12 +718,9 @@ static int mxs_lradc_adc_probe(struct platform_device *pdev) > adc->dev = dev; > > iores = platform_get_resource(pdev, IORESOURCE_MEM, 0); > - if (!iores) > - return -EINVAL; > - > - adc->base = devm_ioremap(dev, iores->start, resource_size(iores)); > - if (!adc->base) > - return -ENOMEM; > + adc->base = devm_ioremap_resource(dev, iores); > + if (IS_ERR(adc->base)) > + return PTR_ERR(adc->base); Just realized that this has already been proposed and does not work: http://www.spinics.net/lists/linux-iio/msg32864.html Please discard it, thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html