diff mbox series

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

Message ID 20200527064140.21391-4-ovidiu.panait@windriver.com
State New
Headers show
Series [1/5] dm: core: Fix devfdt_get_addr_ptr return value | expand

Commit Message

Ovidiu Panait May 27, 2020, 6:41 a.m. UTC
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 mbox series

Patch

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;
 	}