Skip to content

Commit bdf4442

Browse files
Heikki KrogerusAndi Shyti
authored andcommitted
i2c: designware: Don't warn about missing get_clk_rate_khz
Converting the WARN_ON() to a dev_dbg() message in i2c_dw_clk_rate(). That removes the need to supply a dummy implementation for the callback (or alternatively a dummy clk device) when the fallback path is preferred where the existing values already in the clock registers are used - when a firmware has programmed the clock registers. The fallback path was introduced in commit 4fec76e ("i2c: designware: Fix wrong setting for {ss,fs,hs}_{h,l}cnt registers"). Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Link: https://lore.kernel.org/r/20250513124015.2568924-1-heikki.krogerus@linux.intel.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
1 parent 2fe2b96 commit bdf4442

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/i2c/busses/i2c-designware-common.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,8 +572,10 @@ u32 i2c_dw_clk_rate(struct dw_i2c_dev *dev)
572572
* Clock is not necessary if we got LCNT/HCNT values directly from
573573
* the platform code.
574574
*/
575-
if (WARN_ON_ONCE(!dev->get_clk_rate_khz))
575+
if (!dev->get_clk_rate_khz) {
576+
dev_dbg_once(dev->dev, "Callback get_clk_rate_khz() is not defined\n");
576577
return 0;
578+
}
577579
return dev->get_clk_rate_khz(dev);
578580
}
579581

0 commit comments

Comments
 (0)