From: Jianqun Xu Date: Thu, 18 May 2017 01:12:32 +0000 (+0800) Subject: i2c: rk3x: fix to dev_warn_ratelimited X-Git-Tag: release-20171130_firefly~4^2~545 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4dca3e096e36ecac7dd0037c0e34a77b1104d350;p=firefly-linux-kernel-4.4.55.git i2c: rk3x: fix to dev_warn_ratelimited In some case, the log will look bad such as: [ 12.393926] rk3x-i2c ff150000.i2c: irq in STATE_IDLE, ipd = 0x51 [[[[[[[[[[[[.[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ Let's limit the printk: [ 180.446547] rk3x_i2c_irq: 1726030 callbacks suppressed [ 180.446592] rk3x-i2c ff150000.i2c: irq in STATE_IDLE, ipd = 0x51 Change-Id: Ie91163ad3085e5dba127790b50e3beb359510120 Signed-off-by: Jianqun Xu --- diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c index 4bd6be10a42d..5b10f4eaee35 100644 --- a/drivers/i2c/busses/i2c-rk3x.c +++ b/drivers/i2c/busses/i2c-rk3x.c @@ -482,7 +482,9 @@ static irqreturn_t rk3x_i2c_irq(int irqno, void *dev_id) ipd = i2c_readl(i2c, REG_IPD); if (i2c->state == STATE_IDLE) { - dev_warn(i2c->dev, "irq in STATE_IDLE, ipd = 0x%x\n", ipd); + dev_warn_ratelimited(i2c->dev, + "irq in STATE_IDLE, ipd = 0x%x\n", + ipd); rk3x_i2c_clean_ipd(i2c); goto out; }