[PATCH 4/5] pinctrl: bcm283x: Fix return value check for dev_read_addr_ptr

Ovidiu Panait ovidiu.panait at windriver.com
Wed May 27 08:41:39 CEST 2020


dev_read_addr_ptr returns NULL on failure, so add the proper check.

Signed-off-by: Ovidiu Panait <ovidiu.panait at windriver.com>
---

 drivers/pinctrl/broadcom/pinctrl-bcm283x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/broadcom/pinctrl-bcm283x.c b/drivers/pinctrl/broadcom/pinctrl-bcm283x.c
index 9ab0baee33..49791c5962 100644
--- a/drivers/pinctrl/broadcom/pinctrl-bcm283x.c
+++ b/drivers/pinctrl/broadcom/pinctrl-bcm283x.c
@@ -111,7 +111,7 @@ int bcm283x_pinctl_ofdata_to_platdata(struct udevice *dev)
 	priv = dev_get_priv(dev);
 
 	priv->base_reg = dev_read_addr_ptr(dev);
-	if (priv->base_reg == (void *)FDT_ADDR_T_NONE) {
+	if (!priv->base_reg) {
 		debug("%s: Failed to get base address\n", __func__);
 		return -EINVAL;
 	}
-- 
2.17.1



More information about the U-Boot mailing list