From e4cb1d6d7e6298e3c2ecc0da65e8821885c1fdbc Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Fri, 13 Jun 2014 15:22:58 +0800 Subject: [PATCH] i2c: rockchip: fix using smp_processor_id() in preemptible warning Fix this warning when DEBUG_PREEMPT is selected: BUG: using smp_processor_id() in preemptible [00000000] code: cfinteractive/72 caller is rockchip_i2c_doxfer+0x58/0x3cc --- drivers/i2c/busses/i2c-rockchip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-rockchip.c b/drivers/i2c/busses/i2c-rockchip.c index f1c5d9d2ef2b..061c5da0919c 100644 --- a/drivers/i2c/busses/i2c-rockchip.c +++ b/drivers/i2c/busses/i2c-rockchip.c @@ -625,7 +625,6 @@ static int rockchip_i2c_doxfer(struct rockchip_i2c *i2c, */ int msleep_time = 400 * 1000 / i2c->scl_rate; // ms int can_sleep = !(in_atomic() || irqs_disabled()); - int cpu = smp_processor_id(); if (i2c->suspended) { dev_err(i2c->dev, "i2c is suspended\n"); @@ -678,6 +677,7 @@ static int rockchip_i2c_doxfer(struct rockchip_i2c *i2c, } timeout = ret; } else { + int cpu = raw_smp_processor_id(); int tmo = I2C_WAIT_TIMEOUT * USEC_PER_MSEC; while (tmo-- && i2c->is_busy != 0) { spin_unlock_irqrestore(&i2c->lock, flags); -- 2.34.1