[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220106075711.3216468-1-yangyingliang@huawei.com>
Date: Thu, 6 Jan 2022 15:57:11 +0800
From: Yang Yingliang <yangyingliang@...wei.com>
To: <linux-kernel@...r.kernel.org>, <linux-rtc@...r.kernel.org>
CC: <vincent.sunplus@...il.com>, <a.zummo@...ertech.it>,
<alexandre.belloni@...tlin.com>
Subject: [PATCH -next] rtc: rtc-sunplus: fix return value in sp_rtc_probe()
If devm_ioremap_resource() fails, it should return error
code from sp_rtc->reg_base in sp_rtc_probe().
Fixes: fad6cbe9b2b4 ("rtc: Add driver for RTC in Sunplus SP7021")
Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
---
drivers/rtc/rtc-sunplus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-sunplus.c b/drivers/rtc/rtc-sunplus.c
index 0b3873204f5c..e8e2ab1103fc 100644
--- a/drivers/rtc/rtc-sunplus.c
+++ b/drivers/rtc/rtc-sunplus.c
@@ -238,7 +238,7 @@ static int sp_rtc_probe(struct platform_device *plat_dev)
sp_rtc->res = platform_get_resource_byname(plat_dev, IORESOURCE_MEM, RTC_REG_NAME);
sp_rtc->reg_base = devm_ioremap_resource(&plat_dev->dev, sp_rtc->res);
if (IS_ERR(sp_rtc->reg_base))
- return dev_err_probe(&plat_dev->dev, PTR_ERR(sp_rtc->res),
+ return dev_err_probe(&plat_dev->dev, PTR_ERR(sp_rtc->reg_base),
"%s devm_ioremap_resource fail\n", RTC_REG_NAME);
dev_dbg(&plat_dev->dev, "res = 0x%x, reg_base = 0x%lx\n",
sp_rtc->res->start, (unsigned long)sp_rtc->reg_base);
--
2.25.1
Powered by blists - more mailing lists