public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] i2c: designware: Don't warn about missing get_clk_rate_khz
@ 2025-05-13 12:40 Heikki Krogerus
  2025-05-14  6:58 ` Jarkko Nikula
  2025-05-15 15:11 ` Andi Shyti
  0 siblings, 2 replies; 3+ messages in thread
From: Heikki Krogerus @ 2025-05-13 12:40 UTC (permalink / raw)
  To: Jarkko Nikula
  Cc: Andy Shevchenko, Mika Westerberg, Jan Dabros, Andi Shyti,
	Raag Jadav, linux-i2c, linux-kernel

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 4fec76e0985c
("i2c: designware: Fix wrong setting for {ss,fs,hs}_{h,l}cnt
registers").

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
 drivers/i2c/busses/i2c-designware-common.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-designware-common.c b/drivers/i2c/busses/i2c-designware-common.c
index 8eb7bd640f8d..5b1e8f74c4ac 100644
--- a/drivers/i2c/busses/i2c-designware-common.c
+++ b/drivers/i2c/busses/i2c-designware-common.c
@@ -572,8 +572,10 @@ u32 i2c_dw_clk_rate(struct dw_i2c_dev *dev)
 	 * Clock is not necessary if we got LCNT/HCNT values directly from
 	 * the platform code.
 	 */
-	if (WARN_ON_ONCE(!dev->get_clk_rate_khz))
+	if (!dev->get_clk_rate_khz) {
+		dev_dbg_once(dev->dev, "Callback get_clk_rate_khz() is not defined\n");
 		return 0;
+	}
 	return dev->get_clk_rate_khz(dev);
 }
 
-- 
2.47.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-05-15 15:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-13 12:40 [PATCH v1] i2c: designware: Don't warn about missing get_clk_rate_khz Heikki Krogerus
2025-05-14  6:58 ` Jarkko Nikula
2025-05-15 15:11 ` Andi Shyti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox