summaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/bluecard_cs.c
diff options
context:
space:
mode:
authorSachin Kamat <sachin.kamat@linaro.org>2012-07-27 12:38:33 +0530
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2012-08-06 15:03:00 -0300
commit1a31c602c3f6de9383eaae28e25859b6304fc3c2 (patch)
treeef9be4841f06e885e4f0c3c7092c27ef8f8f3e46 /drivers/bluetooth/bluecard_cs.c
parent0213cd8d5ed9cee1d7ffd95566319af1bb36a604 (diff)
downloadop-kernel-dev-1a31c602c3f6de9383eaae28e25859b6304fc3c2.zip
op-kernel-dev-1a31c602c3f6de9383eaae28e25859b6304fc3c2.tar.gz
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>
Diffstat (limited to 'drivers/bluetooth/bluecard_cs.c')
-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 66c3a67..0c0838d 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);
}
OpenPOWER on IntegriCloud