projects
/
deliverable
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
60a0aad
)
leds: convert Atmel PWM LED driver to devm_kzalloc()
author
Bryan Wu
<bryan.wu@canonical.com>
Tue, 3 Jul 2012 05:01:37 +0000
(13:01 +0800)
committer
Bryan Wu
<bryan.wu@canonical.com>
Mon, 23 Jul 2012 23:52:37 +0000
(07:52 +0800)
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
drivers/leds/leds-atmel-pwm.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/leds/leds-atmel-pwm.c
b/drivers/leds/leds-atmel-pwm.c
index 64ad702a2ecc64eff2505fd0f4217126fd10bdf9..45430632faab069d2638afa64b964763475f1e7b 100644
(file)
--- a/
drivers/leds/leds-atmel-pwm.c
+++ b/
drivers/leds/leds-atmel-pwm.c
@@
-46,7
+46,8
@@
static int __devinit pwmled_probe(struct platform_device *pdev)
if (!pdata || pdata->num_leds < 1)
return -ENODEV;
- leds = kcalloc(pdata->num_leds, sizeof(*leds), GFP_KERNEL);
+ leds = devm_kzalloc(&pdev->dev, pdata->num_leds * sizeof(*leds),
+ GFP_KERNEL);
if (!leds)
return -ENOMEM;
@@
-108,7
+109,6
@@
err:
pwm_channel_free(&leds[i].pwmc);
}
}
- kfree(leds);
return status;
}
@@
-129,7
+129,6
@@
static int __exit pwmled_remove(struct platform_device *pdev)
pwm_channel_free(&led->pwmc);
}
- kfree(leds);
platform_set_drvdata(pdev, NULL);
return 0;
}
This page took
0.024618 seconds
and
5
git commands to generate.