All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Wang ShaoBo <bobo.shaobowang@huawei.com>
Cc: <cj.chengjian@huawei.com>, <huawei.libin@huawei.com>,
	<Jonathan.Cameron@huawei.com>, <fabrice.gasnier@st.com>,
	<linux-iio@vger.kernel.org>,
	<linux-stm32@st-md-mailman.stormreply.com>,
	<linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH -next] iio: adc: stm32-dfsdm: Use devm_platform_get_and_ioremap_resource()
Date: Wed, 23 Sep 2020 21:54:12 +0100	[thread overview]
Message-ID: <20200923215357.26f8959d@archlinux> (raw)
In-Reply-To: <20200918083142.32816-1-bobo.shaobowang@huawei.com>

On Fri, 18 Sep 2020 16:31:42 +0800
Wang ShaoBo <bobo.shaobowang@huawei.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@huawei.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


WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron <jic23@kernel.org>
To: Wang ShaoBo <bobo.shaobowang@huawei.com>
Cc: cj.chengjian@huawei.com, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org, huawei.libin@huawei.com,
	Jonathan.Cameron@huawei.com, fabrice.gasnier@st.com,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH -next] iio: adc: stm32-dfsdm: Use devm_platform_get_and_ioremap_resource()
Date: Wed, 23 Sep 2020 21:54:12 +0100	[thread overview]
Message-ID: <20200923215357.26f8959d@archlinux> (raw)
In-Reply-To: <20200918083142.32816-1-bobo.shaobowang@huawei.com>

On Fri, 18 Sep 2020 16:31:42 +0800
Wang ShaoBo <bobo.shaobowang@huawei.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@huawei.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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-09-23 20:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-18  8:31 [PATCH -next] iio: adc: stm32-dfsdm: Use devm_platform_get_and_ioremap_resource() Wang ShaoBo
2020-09-18  8:31 ` Wang ShaoBo
2020-09-23 20:54 ` Jonathan Cameron [this message]
2020-09-23 20:54   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200923215357.26f8959d@archlinux \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=bobo.shaobowang@huawei.com \
    --cc=cj.chengjian@huawei.com \
    --cc=fabrice.gasnier@st.com \
    --cc=huawei.libin@huawei.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.