i2c: rk30: fix idle lock name alloced on stack
author黄涛 <huangtao@rock-chips.com>
Fri, 30 Mar 2012 12:57:17 +0000 (20:57 +0800)
committer黄涛 <huangtao@rock-chips.com>
Fri, 30 Mar 2012 12:57:17 +0000 (20:57 +0800)
drivers/i2c/busses/i2c-rk30.c

index aa817e2c9a0a3c2734fc06352ea14ea40d1f4549..63dd362af514e451ddbccc344710282f5d6de6d1 100755 (executable)
@@ -86,7 +86,6 @@ static int rk30_i2c_probe(struct platform_device *pdev)
        struct rk30_i2c *i2c = NULL;
        struct rk30_i2c_platform_data *pdata = NULL;
        struct resource *res;
-        char name[5];
        int ret;
 
        pdata = pdev->dev.platform_data;
@@ -201,10 +200,9 @@ static int rk30_i2c_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, i2c);
 
-        sprintf(name, "%s%d", "i2c", i2c->adap.nr);
         i2c->is_div_from_arm[i2c->adap.nr] = pdata->is_div_from_arm;
         if(i2c->is_div_from_arm[i2c->adap.nr])
-                wake_lock_init(&i2c->idlelock[i2c->adap.nr], WAKE_LOCK_IDLE, name);
+                wake_lock_init(&i2c->idlelock[i2c->adap.nr], WAKE_LOCK_IDLE, dev_name(&pdev->dev));
 
         i2c->i2c_init_hw(i2c, 100 * 1000);
        dev_info(&pdev->dev, "%s: RK30 I2C adapter\n", dev_name(&i2c->adap.dev));