config: tegra3: enable /dev mount with ACL
[linux-2.6.git] / drivers / mfd / tps65090.c
index ec60ac7..25f463d 100644 (file)
@@ -225,34 +225,31 @@ static int __devinit tps65090_i2c_probe(struct i2c_client *client,
                return -EINVAL;
        }
 
-       tps65090 = devm_kzalloc(&client->dev, sizeof(struct tps65090),
-               GFP_KERNEL);
-       if (tps65090 == NULL)
+       tps65090 = devm_kzalloc(&client->dev, sizeof(*tps65090), GFP_KERNEL);
+       if (!tps65090) {
+               dev_err(&client->dev, "mem alloc for tps65090 failed\n");
                return -ENOMEM;
+       }
 
-       tps65090->client = client;
        tps65090->dev = &client->dev;
        i2c_set_clientdata(client, tps65090);
 
-       mutex_init(&tps65090->lock);
+       tps65090->rmap = devm_regmap_init_i2c(client, &tps65090_regmap_config);
+       if (IS_ERR(tps65090->rmap)) {
+               ret = PTR_ERR(tps65090->rmap);
+               dev_err(&client->dev, "regmap_init failed with err: %d\n", ret);
+               return ret;
+       }
 
        if (client->irq) {
                ret = tps65090_irq_init(tps65090, client->irq, pdata->irq_base);
                if (ret) {
                        dev_err(&client->dev, "IRQ init failed with err: %d\n",
                                ret);
-                       goto err_exit;
+                       return ret;
                }
        }
 
-       tps65090->rmap = devm_regmap_init_i2c(tps65090->client,
-                                             &tps65090_regmap_config);
-       if (IS_ERR(tps65090->rmap)) {
-               ret = PTR_ERR(tps65090->rmap);
-               dev_err(&client->dev, "regmap_init failed with err: %d\n", ret);
-               goto err_irq_exit;
-       }
-
        ret = mfd_add_devices(tps65090->dev, -1, tps65090s,
                ARRAY_SIZE(tps65090s), NULL, 0);
        if (ret) {
@@ -266,7 +263,6 @@ static int __devinit tps65090_i2c_probe(struct i2c_client *client,
 err_irq_exit:
        if (client->irq)
                free_irq(client->irq, tps65090);
-err_exit:
        return ret;
 }