diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2012-07-27 03:08:38 -0400 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-08-06 14:03:02 -0400 |
commit | fdefa118ebbcadad4adbaaab067be06a96a48e15 (patch) | |
tree | 91a2ef79c172784cfd98b2a8a992451c961d23d0 /drivers/bluetooth/btuart_cs.c | |
parent | 3a382772b51bbf55b23701746102bd75b9fe883f (diff) |
Bluetooth: Use devm_kzalloc in btuart_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/btuart_cs.c')
-rw-r--r-- | drivers/bluetooth/btuart_cs.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c index 21e803a6a281..2f510a87b28f 100644 --- a/drivers/bluetooth/btuart_cs.c +++ b/drivers/bluetooth/btuart_cs.c | |||
@@ -567,7 +567,7 @@ static int btuart_probe(struct pcmcia_device *link) | |||
567 | btuart_info_t *info; | 567 | btuart_info_t *info; |
568 | 568 | ||
569 | /* Create new info device */ | 569 | /* Create new info device */ |
570 | info = kzalloc(sizeof(*info), GFP_KERNEL); | 570 | info = devm_kzalloc(&link->dev, sizeof(*info), GFP_KERNEL); |
571 | if (!info) | 571 | if (!info) |
572 | return -ENOMEM; | 572 | return -ENOMEM; |
573 | 573 | ||
@@ -583,10 +583,7 @@ static int btuart_probe(struct pcmcia_device *link) | |||
583 | 583 | ||
584 | static void btuart_detach(struct pcmcia_device *link) | 584 | static void btuart_detach(struct pcmcia_device *link) |
585 | { | 585 | { |
586 | btuart_info_t *info = link->priv; | ||
587 | |||
588 | btuart_release(link); | 586 | btuart_release(link); |
589 | kfree(info); | ||
590 | } | 587 | } |
591 | 588 | ||
592 | static int btuart_check_config(struct pcmcia_device *p_dev, void *priv_data) | 589 | static int btuart_check_config(struct pcmcia_device *p_dev, void *priv_data) |