diff mbox series

i2c: imx_lpi2c: Fix misuse the IS_ENABLED for DM clock

Message ID 20230406102636.18472-1-peng.fan@oss.nxp.com
State Accepted
Commit b4004c2949732ad8a6cb42f27a1c472d39216b72
Delegated to: Heiko Schocher
Headers show
Series i2c: imx_lpi2c: Fix misuse the IS_ENABLED for DM clock | expand

Commit Message

Peng Fan (OSS) April 6, 2023, 10:26 a.m. UTC
From: Ye Li <ye.li@nxp.com>

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.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/i2c/imx_lpi2c.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Heiko Schocher April 11, 2023, 11 a.m. UTC | #1
Hello Peng,

On 06.04.23 12:26, Peng Fan (OSS) wrote:
> From: Ye Li <ye.li@nxp.com>
> 
> 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.
> 
> Reviewed-by: Peng Fan <peng.fan@nxp.com>
> Signed-off-by: Ye Li <ye.li@nxp.com>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  drivers/i2c/imx_lpi2c.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)


Applied to u-boot-i2c.git master

Thanks!

bye,
Heiko
diff mbox series

Patch

diff --git a/drivers/i2c/imx_lpi2c.c b/drivers/i2c/imx_lpi2c.c
index 92c500327b4..ad9293c92e1 100644
--- a/drivers/i2c/imx_lpi2c.c
+++ b/drivers/i2c/imx_lpi2c.c
@@ -282,7 +282,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);
@@ -462,7 +462,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");