Bluetooth: Remove HCI-owner field

After unregistering an hci_dev object a bluetooth driver does not have
any callbacks in the hci_dev structure left over. Therefore, there is no
need to keep a reference to the module.

Previously, we needed this to protect the hci-destruct callback.
However, this callback is no longer available so we do not need this
owner field, anymore.  Drivers now call hci_unregister_dev() and they
are done with the object.

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>
This commit is contained in:
David Herrmann
2012-01-07 15:47:22 +01:00
committed by Johan Hedberg
parent 46e06531a5
commit e9b9cfa157
14 changed files with 3 additions and 35 deletions

View File

@@ -262,8 +262,6 @@ struct hci_dev {
struct rfkill *rfkill;
struct module *owner;
unsigned long dev_flags;
int (*open)(struct hci_dev *hdev);
@@ -601,11 +599,7 @@ static inline void __hci_dev_put(struct hci_dev *d)
* hci_dev_put and hci_dev_hold are macros to avoid dragging all the
* overhead of all the modular infrastructure into this header.
*/
#define hci_dev_put(d) \
do { \
__hci_dev_put(d); \
module_put(d->owner); \
} while (0)
#define hci_dev_put(d) __hci_dev_put(d)
static inline struct hci_dev *__hci_dev_hold(struct hci_dev *d)
{
@@ -613,10 +607,7 @@ static inline struct hci_dev *__hci_dev_hold(struct hci_dev *d)
return d;
}
#define hci_dev_hold(d) \
({ \
try_module_get(d->owner) ? __hci_dev_hold(d) : NULL; \
})
#define hci_dev_hold(d) __hci_dev_hold(d)
#define hci_dev_lock(d) mutex_lock(&d->lock)
#define hci_dev_unlock(d) mutex_unlock(&d->lock)