diff options
author | David Herrmann <dh.herrmann@googlemail.com> | 2012-01-07 09:47:18 -0500 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-02-13 10:01:24 -0500 |
commit | dabbaab394d17ba1d1b55092d553e6e31a3d0afd (patch) | |
tree | d903dc8d2718dff30bc97786385fcbfd3736323a /drivers/bluetooth/btsdio.c | |
parent | d25442ba4b44bf1fad50c9c2156a4ca89f269713 (diff) |
Bluetooth: btsdio: Free driver data on SDIO shutdown
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>
Diffstat (limited to 'drivers/bluetooth/btsdio.c')
-rw-r--r-- | drivers/bluetooth/btsdio.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/bluetooth/btsdio.c b/drivers/bluetooth/btsdio.c index 792e32d29a1d..d38945cc9f05 100644 --- a/drivers/bluetooth/btsdio.c +++ b/drivers/bluetooth/btsdio.c | |||
@@ -289,15 +289,6 @@ static int btsdio_send_frame(struct sk_buff *skb) | |||
289 | return 0; | 289 | return 0; |
290 | } | 290 | } |
291 | 291 | ||
292 | static void btsdio_destruct(struct hci_dev *hdev) | ||
293 | { | ||
294 | struct btsdio_data *data = hdev->driver_data; | ||
295 | |||
296 | BT_DBG("%s", hdev->name); | ||
297 | |||
298 | kfree(data); | ||
299 | } | ||
300 | |||
301 | static int btsdio_probe(struct sdio_func *func, | 292 | static int btsdio_probe(struct sdio_func *func, |
302 | const struct sdio_device_id *id) | 293 | const struct sdio_device_id *id) |
303 | { | 294 | { |
@@ -345,7 +336,6 @@ static int btsdio_probe(struct sdio_func *func, | |||
345 | hdev->close = btsdio_close; | 336 | hdev->close = btsdio_close; |
346 | hdev->flush = btsdio_flush; | 337 | hdev->flush = btsdio_flush; |
347 | hdev->send = btsdio_send_frame; | 338 | hdev->send = btsdio_send_frame; |
348 | hdev->destruct = btsdio_destruct; | ||
349 | 339 | ||
350 | hdev->owner = THIS_MODULE; | 340 | hdev->owner = THIS_MODULE; |
351 | 341 | ||
@@ -378,6 +368,7 @@ static void btsdio_remove(struct sdio_func *func) | |||
378 | hci_unregister_dev(hdev); | 368 | hci_unregister_dev(hdev); |
379 | 369 | ||
380 | hci_free_dev(hdev); | 370 | hci_free_dev(hdev); |
371 | kfree(data); | ||
381 | } | 372 | } |
382 | 373 | ||
383 | static struct sdio_driver btsdio_driver = { | 374 | static struct sdio_driver btsdio_driver = { |