Check the return value of dev_read_addr_ptr() for NULL instead of
IS_ERR(). This function only ever returns NULL on failure.

Fixes: ed1b726683e7 ("timer: mchp-pit64b: add support for pit64b")
Signed-off-by: David Lechner <[email protected]>
---
 drivers/timer/mchp-pit64b-timer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/timer/mchp-pit64b-timer.c 
b/drivers/timer/mchp-pit64b-timer.c
index 1a5b2e6a0dc..117236d51e7 100644
--- a/drivers/timer/mchp-pit64b-timer.c
+++ b/drivers/timer/mchp-pit64b-timer.c
@@ -45,8 +45,8 @@ static int mchp_pit64b_probe(struct udevice *dev)
        int ret;
 
        priv->base = dev_read_addr_ptr(dev);
-       if (IS_ERR(priv->base))
-               return PTR_ERR(priv->base);
+       if (!priv->base)
+               return -EINVAL;
 
        ret = clk_get_by_index(dev, 0, &clk);
        if (ret)

-- 
2.43.0

Reply via email to