提交 75892900 编写于 作者: P Pan Bian 提交者: Alexandre Belloni

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: NPan Bian <bianpan2016@163.com>
Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
上级 538c08f4
...@@ -258,7 +258,7 @@ static int snvs_rtc_probe(struct platform_device *pdev) ...@@ -258,7 +258,7 @@ static int snvs_rtc_probe(struct platform_device *pdev)
of_property_read_u32(pdev->dev.of_node, "offset", &data->offset); 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"); dev_err(&pdev->dev, "Can't find snvs syscon\n");
return -ENODEV; return -ENODEV;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册