X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=drivers%2Fleds%2Fleds-pwm.c;h=f2e44c7194374f135906fc3e9aa4ac87ca33a6bb;hb=080909503664641432cc8adf2ee2084775fd992a;hp=3ed92f34bd4477108549499e7bbf4959af1a56cd;hpb=98961a7e431735c791dbaaf0337029e219a5db5a;p=karo-tx-linux.git diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c index 3ed92f34bd44..f2e44c719437 100644 --- a/drivers/leds/leds-pwm.c +++ b/drivers/leds/leds-pwm.c @@ -57,7 +57,8 @@ static int led_pwm_probe(struct platform_device *pdev) if (!pdata) return -EBUSY; - leds_data = kzalloc(sizeof(struct led_pwm_data) * pdata->num_leds, + leds_data = devm_kzalloc(&pdev->dev, + sizeof(struct led_pwm_data) * pdata->num_leds, GFP_KERNEL); if (!leds_data) return -ENOMEM; @@ -103,8 +104,6 @@ err: } } - kfree(leds_data); - return ret; } @@ -121,8 +120,6 @@ static int __devexit led_pwm_remove(struct platform_device *pdev) pwm_free(leds_data[i].pwm); } - kfree(leds_data); - return 0; }