]> Pileus Git - ~andy/linux/blobdiff - drivers/leds/leds-tca6507.c
sparc32: Move cache and TLB flushes over to method ops.
[~andy/linux] / drivers / leds / leds-tca6507.c
index 133f89fb7071c6b522e2897ac3e3eefaae59daa7..6c1c14f3163505530cf253d1884e2eb7d0bc8099 100644 (file)
@@ -687,10 +687,9 @@ static int __devinit tca6507_probe(struct i2c_client *client,
                        NUM_LEDS);
                return -ENODEV;
        }
-       err = -ENOMEM;
        tca = kzalloc(sizeof(*tca), GFP_KERNEL);
        if (!tca)
-               goto exit;
+               return -ENOMEM;
 
        tca->client = client;
        INIT_WORK(&tca->work, tca6507_work);
@@ -724,11 +723,10 @@ static int __devinit tca6507_probe(struct i2c_client *client,
 
        return 0;
 exit:
-       while (i--)
+       while (i--) {
                if (tca->leds[i].led_cdev.name)
                        led_classdev_unregister(&tca->leds[i].led_cdev);
-       cancel_work_sync(&tca->work);
-       i2c_set_clientdata(client, NULL);
+       }
        kfree(tca);
        return err;
 }
@@ -745,7 +743,6 @@ static int __devexit tca6507_remove(struct i2c_client *client)
        }
        tca6507_remove_gpio(tca);
        cancel_work_sync(&tca->work);
-       i2c_set_clientdata(client, NULL);
        kfree(tca);
 
        return 0;