]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/misc/lis3lv02d/lis3lv02d_i2c.c
lis3: remove the references to the global variable in core driver
[mirror_ubuntu-artful-kernel.git] / drivers / misc / lis3lv02d / lis3lv02d_i2c.c
index b20dfb4522d278eebefa6eb8f2242e78c32f3f8d..6cdc38f6a9a83f671d6030f23aef59911a84568d 100644 (file)
@@ -161,8 +161,13 @@ static int __devinit lis3lv02d_i2c_probe(struct i2c_client *client,
        if (lis3_dev.reg_ctrl)
                lis3_reg_ctrl(&lis3_dev, LIS3_REG_OFF);
 
-       if (ret == 0)
-               return 0;
+       if (ret)
+               goto fail2;
+       return 0;
+
+fail2:
+       regulator_bulk_free(ARRAY_SIZE(lis3_dev.regulators),
+                               lis3_dev.regulators);
 fail:
        if (pdata && pdata->release_resources)
                pdata->release_resources();
@@ -177,7 +182,7 @@ static int __devexit lis3lv02d_i2c_remove(struct i2c_client *client)
        if (pdata && pdata->release_resources)
                pdata->release_resources();
 
-       lis3lv02d_joystick_disable();
+       lis3lv02d_joystick_disable(lis3);
        lis3lv02d_remove_fs(&lis3_dev);
 
        if (lis3_dev.reg_ctrl)