i2c: rk3x: fix to dev_warn_ratelimited
authorJianqun Xu <jay.xu@rock-chips.com>
Thu, 18 May 2017 01:12:32 +0000 (09:12 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Thu, 18 May 2017 08:08:20 +0000 (16:08 +0800)
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 <jay.xu@rock-chips.com>
drivers/i2c/busses/i2c-rk3x.c

index 4bd6be10a42dbc63557e95e48b8b8e1043b9ccb1..5b10f4eaee35bbb7f3c0bdbad5af49c5746e7e3e 100644 (file)
@@ -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;
        }