Commit 0a8d9d4a authored by Bryan Wu's avatar Bryan Wu

leds: convert LT3593 LED driver to devm_kzalloc()

Cc: Daniel Mack <daniel@caiaq.de>
Signed-off-by: default avatarBryan Wu <bryan.wu@canonical.com>
parent bfe4c041
...@@ -149,8 +149,9 @@ static int __devinit lt3593_led_probe(struct platform_device *pdev) ...@@ -149,8 +149,9 @@ static int __devinit lt3593_led_probe(struct platform_device *pdev)
if (!pdata) if (!pdata)
return -EBUSY; return -EBUSY;
leds_data = kzalloc(sizeof(struct lt3593_led_data) * pdata->num_leds, leds_data = devm_kzalloc(&pdev->dev,
GFP_KERNEL); sizeof(struct lt3593_led_data) * pdata->num_leds,
GFP_KERNEL);
if (!leds_data) if (!leds_data)
return -ENOMEM; return -ENOMEM;
...@@ -169,8 +170,6 @@ static int __devinit lt3593_led_probe(struct platform_device *pdev) ...@@ -169,8 +170,6 @@ static int __devinit lt3593_led_probe(struct platform_device *pdev)
for (i = i - 1; i >= 0; i--) for (i = i - 1; i >= 0; i--)
delete_lt3593_led(&leds_data[i]); delete_lt3593_led(&leds_data[i]);
kfree(leds_data);
return ret; return ret;
} }
...@@ -185,8 +184,6 @@ static int __devexit lt3593_led_remove(struct platform_device *pdev) ...@@ -185,8 +184,6 @@ static int __devexit lt3593_led_remove(struct platform_device *pdev)
for (i = 0; i < pdata->num_leds; i++) for (i = 0; i < pdata->num_leds; i++)
delete_lt3593_led(&leds_data[i]); delete_lt3593_led(&leds_data[i]);
kfree(leds_data);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment