From: Anson.Huang@nxp.com
To: a.zummo@towertech.it, alexandre.belloni@bootlin.com,
shawnguo@kernel.org, s.hauer@pengutronix.de,
kernel@pengutronix.de, festevam@gmail.com,
linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Cc: Linux-imx@nxp.com
Subject: [PATCH] rtc: imxdi: use devm_platform_ioremap_resource() to simplify code
Date: Wed, 17 Jul 2019 16:14:11 +0800 [thread overview]
Message-ID: <20190717081411.30622-1-Anson.Huang@nxp.com> (raw)
From: Anson Huang <Anson.Huang@nxp.com>
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-imxdi.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/rtc/rtc-imxdi.c b/drivers/rtc/rtc-imxdi.c
index 3f3d652..f21dc6b 100644
--- a/drivers/rtc/rtc-imxdi.c
+++ b/drivers/rtc/rtc-imxdi.c
@@ -740,7 +740,6 @@ static void dryice_work(struct work_struct *work)
*/
static int __init dryice_rtc_probe(struct platform_device *pdev)
{
- struct resource *res;
struct imxdi_dev *imxdi;
int norm_irq, sec_irq;
int rc;
@@ -751,8 +750,7 @@ static int __init dryice_rtc_probe(struct platform_device *pdev)
imxdi->pdev = pdev;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- imxdi->ioaddr = devm_ioremap_resource(&pdev->dev, res);
+ imxdi->ioaddr = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(imxdi->ioaddr))
return PTR_ERR(imxdi->ioaddr);
--
2.7.4
next reply other threads:[~2019-07-17 8:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-17 8:14 Anson.Huang [this message]
2019-07-22 20:17 ` [PATCH] rtc: imxdi: use devm_platform_ioremap_resource() to simplify code 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=20190717081411.30622-1-Anson.Huang@nxp.com \
--to=anson.huang@nxp.com \
--cc=Linux-imx@nxp.com \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@bootlin.com \
--cc=festevam@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@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).