Skip to content

Commit 587ae08

Browse files
David HerrmannJohan Hedberg
authored andcommitted
Bluetooth: Remove unused hci-destruct cb
The hci-destruct callback is not used by any driver so we can remove it. There is no reason to keep it alive, anymore. Drivers can free their internal data on driver-release and we do not need to provide a public destruct callback. Internally, we still use a destruct callback inside of hci_sysfs.c. This one is used to correctly free our hci_dev data structure if no more users have a reference to it. Signed-off-by: David Herrmann <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
1 parent 797fe79 commit 587ae08

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

include/net/bluetooth/hci_core.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,6 @@ struct hci_dev {
270270
int (*close)(struct hci_dev *hdev);
271271
int (*flush)(struct hci_dev *hdev);
272272
int (*send)(struct sk_buff *skb);
273-
void (*destruct)(struct hci_dev *hdev);
274273
void (*notify)(struct hci_dev *hdev, unsigned int evt);
275274
int (*ioctl)(struct hci_dev *hdev, unsigned int cmd, unsigned long arg);
276275
};
@@ -595,10 +594,7 @@ static inline void hci_conn_put(struct hci_conn *conn)
595594
/* ----- HCI Devices ----- */
596595
static inline void __hci_dev_put(struct hci_dev *d)
597596
{
598-
if (atomic_dec_and_test(&d->refcnt)) {
599-
if (d->destruct)
600-
d->destruct(d);
601-
}
597+
atomic_dec(&d->refcnt);
602598
}
603599

604600
/*

0 commit comments

Comments
 (0)