]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
clk: Fix error checking of dev_read_addr_ptr
authorSean Anderson <seanga2@gmail.com>
Wed, 25 Dec 2019 04:57:47 +0000 (23:57 -0500)
committerLukasz Majewski <lukma@denx.de>
Sun, 26 Jan 2020 11:03:06 +0000 (12:03 +0100)
dev_read_addr_ptr returns NULL on error, not FDT_ADDR_T_NONE.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
drivers/clk/imx/clk-imx6q.c
drivers/clk/imx/clk-imx8mm.c
drivers/clk/imx/clk-imx8mn.c

index 5ae4781d11d768ee2027db8969f655ec3af72427..bd0d3e4f4726b4b5c100c0e27d8afa278adca27d 100644 (file)
@@ -115,7 +115,7 @@ static int imx6q_clk_probe(struct udevice *dev)
 
        /* CCM clocks */
        base = dev_read_addr_ptr(dev);
-       if (base == (void *)FDT_ADDR_T_NONE)
+       if (!base)
                return -EINVAL;
 
        clk_dm(IMX6QDL_CLK_USDHC1_SEL,
index a05dac7c7a1f080093fb48193a914789cfb36d5c..fc41a028f6ca015a730d94a9fda07a5e115fbc85 100644 (file)
@@ -323,7 +323,7 @@ static int imx8mm_clk_probe(struct udevice *dev)
               imx_clk_fixed_factor("sys_pll2_1000m", "sys_pll2_out", 1, 1));
 
        base = dev_read_addr_ptr(dev);
-       if (base == (void *)FDT_ADDR_T_NONE)
+       if (!base)
                return -EINVAL;
 
        clk_dm(IMX8MM_CLK_A53_SRC,
index 4048cc63ccd30e9fd28017c9a6b7f007e14dc476..eb43971ae6fcc8b269b0ade958b143cded424954 100644 (file)
@@ -293,7 +293,7 @@ static int imx8mn_clk_probe(struct udevice *dev)
               imx_clk_fixed_factor("sys_pll2_1000m", "sys_pll2_out", 1, 1));
 
        base = dev_read_addr_ptr(dev);
-       if (base == (void *)FDT_ADDR_T_NONE)
+       if (!base)
                return -EINVAL;
 
        clk_dm(IMX8MN_CLK_A53_SRC,