Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1628903 > unrolled thread
| Started by | Pan Bian <bianpan2016@163.com> |
|---|---|
| First post | 2017-04-23 07:50 +0200 |
| Last post | 2017-04-23 07:50 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH 1/1] rtc: snvs: fix an incorrect check of return value Pan Bian <bianpan2016@163.com> - 2017-04-23 07:50 +0200
| From | Pan Bian <bianpan2016@163.com> |
|---|---|
| Date | 2017-04-23 07:50 +0200 |
| Subject | [PATCH 1/1] rtc: snvs: fix an incorrect check of return value |
| Message-ID | <tzizf-4l2-5@gated-at.bofh.it> |
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>
---
drivers/rtc/rtc-snvs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-snvs.c b/drivers/rtc/rtc-snvs.c
index d51b07d..d8ef9e0 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;
}
--
1.9.1
Back to top | Article view | linux.kernel
csiph-web