[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200923215357.26f8959d@archlinux>
Date: Wed, 23 Sep 2020 21:54:12 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Wang ShaoBo <bobo.shaobowang@...wei.com>
Cc: <cj.chengjian@...wei.com>, <huawei.libin@...wei.com>,
<Jonathan.Cameron@...wei.com>, <fabrice.gasnier@...com>,
<linux-iio@...r.kernel.org>,
<linux-stm32@...md-mailman.stormreply.com>,
<linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH -next] iio: adc: stm32-dfsdm: Use
devm_platform_get_and_ioremap_resource()
On Fri, 18 Sep 2020 16:31:42 +0800
Wang ShaoBo <bobo.shaobowang@...wei.com> wrote:
> Make use of devm_platform_get_and_ioremap_resource() provided by
> driver core platform instead of duplicated analogue, dev_err() is
> removed because it has been done in devm_ioremap_resource().
>
> Signed-off-by: Wang ShaoBo <bobo.shaobowang@...wei.com>
Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to see if they can find any problems.
Thanks,
Jonathan
> ---
> drivers/iio/adc/stm32-dfsdm-core.c | 11 ++++-------
> 1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/iio/adc/stm32-dfsdm-core.c b/drivers/iio/adc/stm32-dfsdm-core.c
> index 0b8bea88b011..42a7377704a4 100644
> --- a/drivers/iio/adc/stm32-dfsdm-core.c
> +++ b/drivers/iio/adc/stm32-dfsdm-core.c
> @@ -226,16 +226,13 @@ static int stm32_dfsdm_parse_of(struct platform_device *pdev,
> if (!node)
> return -EINVAL;
>
> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - if (!res) {
> - dev_err(&pdev->dev, "Failed to get memory resource\n");
> - return -ENODEV;
> - }
> - priv->dfsdm.phys_base = res->start;
> - priv->dfsdm.base = devm_ioremap_resource(&pdev->dev, res);
> + priv->dfsdm.base = devm_platform_get_and_ioremap_resource(pdev, 0,
> + &res);
> if (IS_ERR(priv->dfsdm.base))
> return PTR_ERR(priv->dfsdm.base);
>
> + priv->dfsdm.phys_base = res->start;
> +
> /*
> * "dfsdm" clock is mandatory for DFSDM peripheral clocking.
> * "dfsdm" or "audio" clocks can be used as source clock for
Powered by blists - more mailing lists