During EDID reads, repeated i2c errors can flood the kernel log:

[   25.361716] dwhdmiqp-rockchip fde80000.hdmi: i2c read error
[   25.363376] dwhdmiqp-rockchip fde80000.hdmi: i2c read error
...
[   25.368671] dwhdmiqp-rockchip fde80000.hdmi: i2c read error
[   25.369440] dwhdmiqp-rockchip fde80000.hdmi: failed to get edid

Switch to dev_err_ratelimited() in dw_hdmi_qp_i2c_read() to reduce log
spam while still reporting the condition.

Reviewed-by: Heiko Stuebner <[email protected]>
Signed-off-by: Cristian Ciocaltea <[email protected]>
---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c 
b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
index 1c214a8e6dc2..b3318655ceab 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
@@ -561,7 +561,7 @@ static int dw_hdmi_qp_i2c_read(struct dw_hdmi_qp *hdmi,
                                dev_dbg_ratelimited(hdmi->dev,
                                                    "i2c read timed out\n");
                        else
-                               dev_err(hdmi->dev, "i2c read timed out\n");
+                               dev_err_ratelimited(hdmi->dev, "i2c read timed 
out\n");
                        dw_hdmi_qp_write(hdmi, 0x01, I2CM_CONTROL0);
                        return -EAGAIN;
                }
@@ -572,7 +572,7 @@ static int dw_hdmi_qp_i2c_read(struct dw_hdmi_qp *hdmi,
                                dev_dbg_ratelimited(hdmi->dev,
                                                    "i2c read error\n");
                        else
-                               dev_err(hdmi->dev, "i2c read error\n");
+                               dev_err_ratelimited(hdmi->dev, "i2c read 
error\n");
                        dw_hdmi_qp_write(hdmi, 0x01, I2CM_CONTROL0);
                        return -EIO;
                }

-- 
2.54.0

Reply via email to