]> git.baikalelectronics.ru Git - kernel.git/commit
Bluetooth: bfusb: Free driver_data on USB shutdown
authorDavid Herrmann <dh.herrmann@googlemail.com>
Sat, 7 Jan 2012 14:47:15 +0000 (15:47 +0100)
committerJohan Hedberg <johan.hedberg@intel.com>
Mon, 13 Feb 2012 15:01:23 +0000 (17:01 +0200)
commitac4ab0b8db58f4b724984a64ad4d241de8ba11ba
tree217b7a2d5d7cb707de6ed9826e2cd2fafeed3a66
parentb4978983f56ee3a34d4b00eaf75eb45133b896d9
Bluetooth: bfusb: Free driver_data on USB shutdown

This frees the private driver data on USB shutdown instead of using the
hci-destruct callback. We already call usb_set_intfdata(intf, NULL) but
we do not do the same with the hci object. This would be totally safe,
though.

After calling hci_unregister_dev()/hci_free_dev() the hdev object will
never call any callback of us again except the destruct callback.
Therefore, we can safely set the destruct callback to NULL and free the
driver data right away.  This allows to unload the module without
waiting for the hdev device to be released.

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>
drivers/bluetooth/bfusb.c