diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2012-07-27 03:08:33 -0400 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-08-06 14:03:00 -0400 |
commit | 1a31c602c3f6de9383eaae28e25859b6304fc3c2 (patch) | |
tree | ef9be4841f06e885e4f0c3c7092c27ef8f8f3e46 | |
parent | 0213cd8d5ed9cee1d7ffd95566319af1bb36a604 (diff) |
Bluetooth: Use devm_kzalloc in bluecard_cs.c file
devm_kzalloc() eliminates the need to free memory explicitly
thereby saving some cleanup code.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
-rw-r--r-- | drivers/bluetooth/bluecard_cs.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c index 66c3a6770c41..0c0838d9b56c 100644 --- a/drivers/bluetooth/bluecard_cs.c +++ b/drivers/bluetooth/bluecard_cs.c | |||
@@ -849,7 +849,7 @@ static int bluecard_probe(struct pcmcia_device *link) | |||
849 | bluecard_info_t *info; | 849 | bluecard_info_t *info; |
850 | 850 | ||
851 | /* Create new info device */ | 851 | /* Create new info device */ |
852 | info = kzalloc(sizeof(*info), GFP_KERNEL); | 852 | info = devm_kzalloc(&link->dev, sizeof(*info), GFP_KERNEL); |
853 | if (!info) | 853 | if (!info) |
854 | return -ENOMEM; | 854 | return -ENOMEM; |
855 | 855 | ||
@@ -864,10 +864,7 @@ static int bluecard_probe(struct pcmcia_device *link) | |||
864 | 864 | ||
865 | static void bluecard_detach(struct pcmcia_device *link) | 865 | static void bluecard_detach(struct pcmcia_device *link) |
866 | { | 866 | { |
867 | bluecard_info_t *info = link->priv; | ||
868 | |||
869 | bluecard_release(link); | 867 | bluecard_release(link); |
870 | kfree(info); | ||
871 | } | 868 | } |
872 | 869 | ||
873 | 870 | ||