diff options
author | Bryan Wu <bryan.wu@canonical.com> | 2012-07-03 23:40:10 -0400 |
---|---|---|
committer | Bryan Wu <bryan.wu@canonical.com> | 2012-07-23 19:52:38 -0400 |
commit | 983ce8840c9cbafefd568f6973e531d77119a977 (patch) | |
tree | 77d011577c071fba3e455fa7212fa18b5ac9d09a | |
parent | ac63ff50ad37369b838e1416665ff8ca7e9c9b1b (diff) |
leds: convert PCA9633 LED driver to devm_kzalloc()
Cc: Peter Meerwald <p.meerwald@bct-electronic.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
-rw-r--r-- | drivers/leds/leds-pca9633.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/leds/leds-pca9633.c b/drivers/leds/leds-pca9633.c index d8926fd031aa..edcd706c5631 100644 --- a/drivers/leds/leds-pca9633.c +++ b/drivers/leds/leds-pca9633.c | |||
@@ -108,7 +108,7 @@ static int __devinit pca9633_probe(struct i2c_client *client, | |||
108 | } | 108 | } |
109 | } | 109 | } |
110 | 110 | ||
111 | pca9633 = kcalloc(4, sizeof(*pca9633), GFP_KERNEL); | 111 | pca9633 = devm_kzalloc(&client->dev, 4 * sizeof(*pca9633), GFP_KERNEL); |
112 | if (!pca9633) | 112 | if (!pca9633) |
113 | return -ENOMEM; | 113 | return -ENOMEM; |
114 | 114 | ||
@@ -156,8 +156,6 @@ exit: | |||
156 | cancel_work_sync(&pca9633[i].work); | 156 | cancel_work_sync(&pca9633[i].work); |
157 | } | 157 | } |
158 | 158 | ||
159 | kfree(pca9633); | ||
160 | |||
161 | return err; | 159 | return err; |
162 | } | 160 | } |
163 | 161 | ||
@@ -171,8 +169,6 @@ static int __devexit pca9633_remove(struct i2c_client *client) | |||
171 | cancel_work_sync(&pca9633[i].work); | 169 | cancel_work_sync(&pca9633[i].work); |
172 | } | 170 | } |
173 | 171 | ||
174 | kfree(pca9633); | ||
175 | |||
176 | return 0; | 172 | return 0; |
177 | } | 173 | } |
178 | 174 | ||