Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75892900 authored by Pan Bian's avatar Pan Bian Committed by Alexandre Belloni
Browse files

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: default avatarPan Bian <bianpan2016@163.com>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
parent 538c08f4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
	}