Bluetooth: debug: Print refcnt for hci_dev
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>
Thu, 6 Sep 2012 12:05:45 +0000 (15:05 +0300)
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>
Sat, 8 Sep 2012 21:06:10 +0000 (18:06 -0300)
Add debug output for HCI kref.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
include/net/bluetooth/hci_core.h

index 4704ca4b87679344582456a0b17f2ecd6c378d38..6a3337e9c42c1b60372b62e113ea04cec08fe5fc 100644 (file)
@@ -603,11 +603,17 @@ static inline void hci_conn_put(struct hci_conn *conn)
 /* ----- HCI Devices ----- */
 static inline void hci_dev_put(struct hci_dev *d)
 {
+       BT_DBG("%s orig refcnt %d", d->name,
+              atomic_read(&d->dev.kobj.kref.refcount));
+
        put_device(&d->dev);
 }
 
 static inline struct hci_dev *hci_dev_hold(struct hci_dev *d)
 {
+       BT_DBG("%s orig refcnt %d", d->name,
+              atomic_read(&d->dev.kobj.kref.refcount));
+
        get_device(&d->dev);
        return d;
 }