Skip to content

Commit

Permalink
Bluetooth: btsdio: Free driver data on SDIO shutdown
Browse files Browse the repository at this point in the history
Instead of waiting for the hdev object to get freed we now free the
private driver-internal data on SDIO shutdown. This allows us to remove
the obsolete hci-destruct callback and free our data object right away
after calling hci_unregister_dev(). The HCI-core does not call any
callbacks after this so we are never called again and can safely exit
the module.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  • Loading branch information
David Herrmann authored and Johan Hedberg committed Feb 13, 2012
1 parent d25442b commit dabbaab
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions drivers/bluetooth/btsdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,15 +289,6 @@ static int btsdio_send_frame(struct sk_buff *skb)
return 0;
}

static void btsdio_destruct(struct hci_dev *hdev)
{
struct btsdio_data *data = hdev->driver_data;

BT_DBG("%s", hdev->name);

kfree(data);
}

static int btsdio_probe(struct sdio_func *func,
const struct sdio_device_id *id)
{
Expand Down Expand Up @@ -345,7 +336,6 @@ static int btsdio_probe(struct sdio_func *func,
hdev->close = btsdio_close;
hdev->flush = btsdio_flush;
hdev->send = btsdio_send_frame;
hdev->destruct = btsdio_destruct;

hdev->owner = THIS_MODULE;

Expand Down Expand Up @@ -378,6 +368,7 @@ static void btsdio_remove(struct sdio_func *func)
hci_unregister_dev(hdev);

hci_free_dev(hdev);
kfree(data);
}

static struct sdio_driver btsdio_driver = {
Expand Down

0 comments on commit dabbaab

Please sign in to comment.