rtc: snvs: fix an incorrect check of return value
authorPan Bian <bianpan2016@163.com>
Sun, 23 Apr 2017 05:43:24 +0000 (13:43 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Apr 2018 17:47:50 +0000 (19:47 +0200)
commitd36d6e43078a6ccc1e984534f292e19ab2733935
treefdec63b798a50e95bc920ef502e0e95d011c6a2c
parentbeaf445bdd0677d45032aa082faa8dc106526bd5
rtc: snvs: fix an incorrect check of return value

[ Upstream commit 758929005f06f954b7e1c87a1c9fdb44157b228f ]

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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/rtc/rtc-snvs.c