summaryrefslogtreecommitdiffstats
path: root/drivers/leds
diff options
context:
space:
mode:
authorBryan Wu <bryan.wu@canonical.com>2012-07-04 12:20:41 +0800
committerBryan Wu <bryan.wu@canonical.com>2012-07-24 07:52:39 +0800
commit6770fc60c4fb3fac9578013103012b7cd0355e44 (patch)
tree6e30eba5b9c671dc4f4f45968c6301ff9576f953 /drivers/leds
parenta44cdd2c1a527a08069d9635a9e8e1a2e9473e98 (diff)
downloadlinux-6770fc60c4fb3fac9578013103012b7cd0355e44.tar.gz
linux-6770fc60c4fb3fac9578013103012b7cd0355e44.tar.bz2
linux-6770fc60c4fb3fac9578013103012b7cd0355e44.zip
leds: convert TCA6507 LED driver to devm_kzalloc()
Cc: Neil Brown <neilb@suse.de> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/leds-tca6507.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/leds/leds-tca6507.c b/drivers/leds/leds-tca6507.c
index f74a45a49f47..dabcf7ae8d0f 100644
--- a/drivers/leds/leds-tca6507.c
+++ b/drivers/leds/leds-tca6507.c
@@ -687,7 +687,7 @@ static int __devinit tca6507_probe(struct i2c_client *client,
NUM_LEDS);
return -ENODEV;
}
- tca = kzalloc(sizeof(*tca), GFP_KERNEL);
+ tca = devm_kzalloc(&client->dev, sizeof(*tca), GFP_KERNEL);
if (!tca)
return -ENOMEM;
@@ -727,7 +727,6 @@ exit:
if (tca->leds[i].led_cdev.name)
led_classdev_unregister(&tca->leds[i].led_cdev);
}
- kfree(tca);
return err;
}
@@ -743,7 +742,6 @@ static int __devexit tca6507_remove(struct i2c_client *client)
}
tca6507_remove_gpio(tca);
cancel_work_sync(&tca->work);
- kfree(tca);
return 0;
}