Skip to content

Commit

Permalink
rtc: snvs: fix an incorrect check of return value
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
SinkFinder authored and alexandrebelloni committed May 4, 2017
1 parent 538c08f commit 7589290
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/rtc/rtc-snvs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 7589290

Please sign in to comment.