rtc: snvs: fix an incorrect check of return value
PATCH 1/1 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 <[email protected]>
--- drivers/rtc/rtc-snvs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-snvs.c +1 -1
@@ -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 ; }
Signature · 1 line
1.9.1
Alexandre Belloni
AppliedQuoted 9 lines · Pan Bian
Function
devm_regmap_init_mmio()returns anERR_PTRon error. However, in functionsnvs_rtc_probe()its return value is checked against NULL. This patch fixes it by checking the return value withIS_ERR().Signed-off-by Pan Bian <[email protected]>--- drivers/rtc/rtc-snvs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.
Signature · 13 lines
Alexandre Belloni, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com -- You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. --- You received this message because you are subscribed to the Google Groups "rtc-linux" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.