lkml.org 
[lkml]   [2012]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 24/25] leds: convert Heartbeat LED trigger driver to devm_kzalloc()
Date
Cc: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
---
drivers/leds/ledtrig-heartbeat.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/leds/ledtrig-heartbeat.c b/drivers/leds/ledtrig-heartbeat.c
index d3039f2..5caa01b 100644
--- a/drivers/leds/ledtrig-heartbeat.c
+++ b/drivers/leds/ledtrig-heartbeat.c
@@ -75,7 +75,8 @@ static void heartbeat_trig_activate(struct led_classdev *led_cdev)
{
struct heartbeat_trig_data *heartbeat_data;

- heartbeat_data = kzalloc(sizeof(*heartbeat_data), GFP_KERNEL);
+ heartbeat_data = devm_kzalloc(led_cdev->dev, sizeof(*heartbeat_data),
+ GFP_KERNEL);
if (!heartbeat_data)
return;

@@ -93,7 +94,6 @@ static void heartbeat_trig_deactivate(struct led_classdev *led_cdev)

if (led_cdev->activated) {
del_timer_sync(&heartbeat_data->timer);
- kfree(heartbeat_data);
led_cdev->activated = false;
}
}
--
1.7.10.4


\
 
 \ /
  Last update: 2012-07-04 08:01    [W:0.160 / U:4.264 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site