diff options
author | Pan Bian <bianpan2016@163.com> | 2017-04-23 13:43:24 +0800 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@free-electrons.com> | 2017-05-05 00:43:50 +0200 |
commit | 758929005f06f954b7e1c87a1c9fdb44157b228f (patch) | |
tree | 8723a25f9a32982ee8fffff47e0d6756293daca4 /drivers/rtc/rtc-snvs.c | |
parent | 538c08f4c89580fc644e2bc64e0a4b86c925da4e (diff) | |
download | lwn-758929005f06f954b7e1c87a1c9fdb44157b228f.tar.gz lwn-758929005f06f954b7e1c87a1c9fdb44157b228f.zip |
rtc: snvs: fix an incorrect check of return value
Function devm_regmap_init_mmio() returns an ERR_PTR on error. However,
in function snvs_rtc_probe() its return value is checked against NULL.
This patch fixes it by checking the return value with IS_ERR().
Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Diffstat (limited to 'drivers/rtc/rtc-snvs.c')
-rw-r--r-- | drivers/rtc/rtc-snvs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-snvs.c b/drivers/rtc/rtc-snvs.c index d51b07d620f7..d8ef9e052c4f 100644 --- a/drivers/rtc/rtc-snvs.c +++ b/drivers/rtc/rtc-snvs.c @@ -258,7 +258,7 @@ static int snvs_rtc_probe(struct platform_device *pdev) of_property_read_u32(pdev->dev.of_node, "offset", &data->offset); } - if (!data->regmap) { + if (IS_ERR(data->regmap)) { dev_err(&pdev->dev, "Can't find snvs syscon\n"); return -ENODEV; } |