linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mukesh Ojha <mojha@codeaurora.org>
To: Anson Huang <anson.huang@nxp.com>,
	"a.zummo@towertech.it" <a.zummo@towertech.it>,
	"alexandre.belloni@bootlin.com" <alexandre.belloni@bootlin.com>,
	"linux-rtc@vger.kernel.org" <linux-rtc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: dl-linux-imx <linux-imx@nxp.com>
Subject: Re: [PATCH] rtc: snvs: use devm_platform_ioremap_resource() to simplify code
Date: Mon, 1 Apr 2019 13:27:20 +0530	[thread overview]
Message-ID: <8a485ab9-435f-4dfc-1e3d-4dc97e95376a@codeaurora.org> (raw)
In-Reply-To: <1554096271-17921-1-git-send-email-Anson.Huang@nxp.com>


On 4/1/2019 10:59 AM, Anson Huang wrote:
> Use the new helper devm_platform_ioremap_resource() which wraps the
> platform_get_resource() and devm_ioremap_resource() together, to
> simplify the code.
>
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
>   drivers/rtc/rtc-snvs.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/rtc/rtc-snvs.c b/drivers/rtc/rtc-snvs.c
> index ce73eab..e0edd594 100644
> --- a/drivers/rtc/rtc-snvs.c
> +++ b/drivers/rtc/rtc-snvs.c
> @@ -272,7 +272,6 @@ static const struct regmap_config snvs_rtc_config = {
>   static int snvs_rtc_probe(struct platform_device *pdev)
>   {
>   	struct snvs_rtc_data *data;
> -	struct resource *res;
>   	int ret;
>   	void __iomem *mmio;
>   
> @@ -284,9 +283,8 @@ static int snvs_rtc_probe(struct platform_device *pdev)
>   
>   	if (IS_ERR(data->regmap)) {
>   		dev_warn(&pdev->dev, "snvs rtc: you use old dts file, please update it\n");
> -		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>   
Remove this blank line.

Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>

Cheers,
-Mukesh

> -		mmio = devm_ioremap_resource(&pdev->dev, res);
> +		mmio = devm_platform_ioremap_resource(pdev, 0);
>   		if (IS_ERR(mmio))
>   			return PTR_ERR(mmio);
>   

  reply	other threads:[~2019-04-01  7:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-01  5:29 [PATCH] rtc: snvs: use devm_platform_ioremap_resource() to simplify code Anson Huang
2019-04-01  7:57 ` Mukesh Ojha [this message]
2019-04-01 13:12 ` Alexandre Belloni

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=8a485ab9-435f-4dfc-1e3d-4dc97e95376a@codeaurora.org \
    --to=mojha@codeaurora.org \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=anson.huang@nxp.com \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).