diff options
author | Ye Li <ye.li@nxp.com> | 2022-06-02 11:57:18 +0800 |
---|---|---|
committer | Ye Li <ye.li@nxp.com> | 2022-07-06 22:40:40 +0800 |
commit | 095bf99c7917efb1762f3b9298bb0b70e37eb4bb (patch) | |
tree | de8e2e8b36194f02eaf2414d5c1d84d65c13159c | |
parent | dea544c0b8dc58ec035630b63bfafdc978ee3e32 (diff) |
MLK-25927 i2c: imx_lpi2c: Fix misuse the IS_ENABLED for DM clock
The IS_ENABLED, which does not consider SPL build, should be replaced
by CONFIG_IS_ENABLED.
For the case that we only enable DM CLK for u-boot but not in SPL, the
IS_ENABLED(CONFIG_CLK) still returns true, then cause clock failure.
Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
-rw-r--r-- | drivers/i2c/imx_lpi2c.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/i2c/imx_lpi2c.c b/drivers/i2c/imx_lpi2c.c index 961a6b567d..9a652445aa 100644 --- a/drivers/i2c/imx_lpi2c.c +++ b/drivers/i2c/imx_lpi2c.c @@ -283,7 +283,7 @@ static int bus_i2c_set_bus_speed(struct udevice *bus, int speed) bool mode; int i; - if (IS_ENABLED(CONFIG_CLK)) { + if (CONFIG_IS_ENABLED(CLK)) { clock_rate = clk_get_rate(&i2c_bus->per_clk); if (clock_rate <= 0) { dev_err(bus, "Failed to get i2c clk: %d\n", clock_rate); @@ -463,7 +463,7 @@ static int imx_lpi2c_probe(struct udevice *bus) return ret; } - if (IS_ENABLED(CONFIG_CLK)) { + if (CONFIG_IS_ENABLED(CLK)) { ret = clk_get_by_name(bus, "per", &i2c_bus->per_clk); if (ret) { dev_err(bus, "Failed to get per clk\n"); |