watchdog: jz4740: Fix return value check in jz4740_wdt_probe()
authorWei Yongjun <weiyongjun1@huawei.com>
Thu, 4 Mar 2021 04:59:09 +0000 (04:59 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Jul 2021 14:05:51 +0000 (16:05 +0200)
commit5577eece796fe47a4c8aa42422149aab296cf9c0
treee46a167c6a3f03088ace9dd1744243b2c8b69722
parent3b93d520ac533cadd5b8b4ef25623f744ab54882
watchdog: jz4740: Fix return value check in jz4740_wdt_probe()

[ Upstream commit 29e85f53fb58b45b9e9276dcdf1f1cb762dd1c9f ]

In case of error, the function device_node_to_regmap() returns
ERR_PTR() and never returns NULL. The NULL test in the return
value check should be replaced with IS_ERR().

Fixes: 6d532143c915 ("watchdog: jz4740: Use regmap provided by TCU driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20210304045909.945799-1-weiyongjun1@huawei.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/watchdog/jz4740_wdt.c