summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSachin Kamat <sachin.kamat@linaro.org>2012-07-27 09:08:33 +0200
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2012-08-06 20:03:00 +0200
commit1a31c602c3f6de9383eaae28e25859b6304fc3c2 (patch)
treeef9be4841f06e885e4f0c3c7092c27ef8f8f3e46
parentBluetooth: Use devm_kzalloc in bfusb.c file (diff)
downloadlinux-1a31c602c3f6de9383eaae28e25859b6304fc3c2.tar.xz
linux-1a31c602c3f6de9383eaae28e25859b6304fc3c2.zip
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.c5
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)
bluecard_info_t *info;
/* Create new info device */
- info = kzalloc(sizeof(*info), GFP_KERNEL);
+ info = devm_kzalloc(&link->dev, sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;
@@ -864,10 +864,7 @@ static int bluecard_probe(struct pcmcia_device *link)
static void bluecard_detach(struct pcmcia_device *link)
{
- bluecard_info_t *info = link->priv;
-
bluecard_release(link);
- kfree(info);
}