summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-mxc.c
diff options
context:
space:
mode:
authorAnson Huang <anson.huang@nxp.com>2019-04-01 08:21:43 +0300
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2019-04-04 11:07:11 +0300
commitcf37fa79a7617049223172f1e7729da8deb5cd01 (patch)
tree376ae54552b6033f433f173c0c090f520a91dc6c /drivers/rtc/rtc-mxc.c
parente7afddb2b4d24fba318f5e74216bae06dcb36a10 (diff)
downloadlinux-cf37fa79a7617049223172f1e7729da8deb5cd01.tar.xz
rtc: mxc: use devm_platform_ioremap_resource() to simplify code
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> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-mxc.c')
-rw-r--r--drivers/rtc/rtc-mxc.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c
index 878c6ee82901..28a15bd11538 100644
--- a/drivers/rtc/rtc-mxc.c
+++ b/drivers/rtc/rtc-mxc.c
@@ -318,7 +318,6 @@ static const struct rtc_class_ops mxc_rtc_ops = {
static int mxc_rtc_probe(struct platform_device *pdev)
{
- struct resource *res;
struct rtc_device *rtc;
struct rtc_plat_data *pdata = NULL;
u32 reg;
@@ -336,8 +335,7 @@ static int mxc_rtc_probe(struct platform_device *pdev)
else
pdata->devtype = pdev->id_entry->driver_data;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- pdata->ioaddr = devm_ioremap_resource(&pdev->dev, res);
+ pdata->ioaddr = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(pdata->ioaddr))
return PTR_ERR(pdata->ioaddr);