Skip to content

Commit 5ceee54

Browse files
Yang Yingliangalexandrebelloni
authored andcommitted
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: fad6cbe ("rtc: Add driver for RTC in Sunplus SP7021") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20220106075711.3216468-1-yangyingliang@huawei.com
1 parent ff164ae commit 5ceee54

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/rtc/rtc-sunplus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ static int sp_rtc_probe(struct platform_device *plat_dev)
238238
sp_rtc->res = platform_get_resource_byname(plat_dev, IORESOURCE_MEM, RTC_REG_NAME);
239239
sp_rtc->reg_base = devm_ioremap_resource(&plat_dev->dev, sp_rtc->res);
240240
if (IS_ERR(sp_rtc->reg_base))
241-
return dev_err_probe(&plat_dev->dev, PTR_ERR(sp_rtc->res),
241+
return dev_err_probe(&plat_dev->dev, PTR_ERR(sp_rtc->reg_base),
242242
"%s devm_ioremap_resource fail\n", RTC_REG_NAME);
243243
dev_dbg(&plat_dev->dev, "res = 0x%x, reg_base = 0x%lx\n",
244244
sp_rtc->res->start, (unsigned long)sp_rtc->reg_base);

0 commit comments

Comments
 (0)