From 3fe69d3764c3ca6f304c51faa6aae7a84f1fa56c Mon Sep 17 00:00:00 2001 From: Ovidiu Panait Date: Mon, 3 Aug 2020 22:17:35 +0300 Subject: dm: core: Fix devfdt_get_addr_ptr return value According to the description of devfdt_get_addr_ptr, this function should return NULL on failure, but currently it returns (void *)FDT_ADDR_T_NONE. Fix this by making devfdt_get_addr_ptr return NULL on failure, as described in the function comments. Also, update the drivers currently checking (void *)FDT_ADDR_T_NONE to check for NULL. Signed-off-by: Ovidiu Panait Reviewed-by: Simon Glass --- drivers/watchdog/ast_wdt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/watchdog') diff --git a/drivers/watchdog/ast_wdt.c b/drivers/watchdog/ast_wdt.c index 7e11465a57..a21f9a4d14 100644 --- a/drivers/watchdog/ast_wdt.c +++ b/drivers/watchdog/ast_wdt.c @@ -91,8 +91,8 @@ static int ast_wdt_ofdata_to_platdata(struct udevice *dev) struct ast_wdt_priv *priv = dev_get_priv(dev); priv->regs = devfdt_get_addr_ptr(dev); - if (IS_ERR(priv->regs)) - return PTR_ERR(priv->regs); + if (!priv->regs) + return -EINVAL; return 0; } -- cgit