projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4aad381
)
leds: convert LP3944 LED driver to devm_kzalloc()
author
Bryan Wu
<
[email protected]
>
Tue, 3 Jul 2012 05:04:32 +0000
(13:04 +0800)
committer
Bryan Wu
<
[email protected]
>
Mon, 23 Jul 2012 23:52:37 +0000
(07:52 +0800)
Cc: Antonio Ospite <
[email protected]
>
Signed-off-by: Bryan Wu <
[email protected]
>
drivers/leds/leds-lp3944.c
patch
|
blob
|
history
diff --git
a/drivers/leds/leds-lp3944.c
b/drivers/leds/leds-lp3944.c
index b8f9f0a5d4318d1291e377fe1fd4599d3bc15e13..c298f7d9f5357eb27fe302c2a96d906b2ab38b66 100644
(file)
--- a/
drivers/leds/leds-lp3944.c
+++ b/
drivers/leds/leds-lp3944.c
@@
-393,7
+393,8
@@
static int __devinit lp3944_probe(struct i2c_client *client,
return -ENODEV;
}
- data = kzalloc(sizeof(struct lp3944_data), GFP_KERNEL);
+ data = devm_kzalloc(&client->dev, sizeof(struct lp3944_data),
+ GFP_KERNEL);
if (!data)
return -ENOMEM;
@@
-403,10
+404,8
@@
static int __devinit lp3944_probe(struct i2c_client *client,
mutex_init(&data->lock);
err = lp3944_configure(client, data, lp3944_pdata);
- if (err < 0) {
- kfree(data);
+ if (err < 0)
return err;
- }
dev_info(&client->dev, "lp3944 enabled\n");
return 0;
@@
-431,8
+430,6
@@
static int __devexit lp3944_remove(struct i2c_client *client)
break;
}
- kfree(data);
-
return 0;
}