Bluetooth: Add bt_dev logging macros
authorLoic Poulain <loic.poulain@intel.com>
Sun, 30 Aug 2015 16:16:55 +0000 (18:16 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 17 Sep 2015 11:20:00 +0000 (13:20 +0200)
Add specific bluetooth device logging macros since hci device name is
repeatedly referred in bluetooth subsystem logs.

Signed-off-by: Loic Poulain <loic.poulain@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
include/net/bluetooth/bluetooth.h

index 38d8a34..fcf2ae7 100644 (file)
@@ -128,6 +128,13 @@ void bt_err(const char *fmt, ...);
 #define BT_ERR(fmt, ...)       bt_err(fmt "\n", ##__VA_ARGS__)
 #define BT_DBG(fmt, ...)       pr_debug(fmt "\n", ##__VA_ARGS__)
 
+#define bt_dev_info(hdev, fmt, ...)                            \
+       BT_INFO("%s: " fmt, (hdev)->name, ##__VA_ARGS__)
+#define bt_dev_err(hdev, fmt, ...)                             \
+       BT_ERR("%s: " fmt, (hdev)->name, ##__VA_ARGS__)
+#define bt_dev_dbg(hdev, fmt, ...)                             \
+       BT_DBG("%s: " fmt, (hdev)->name, ##__VA_ARGS__)
+
 /* Connection and socket states */
 enum {
        BT_CONNECTED = 1, /* Equal to TCP_ESTABLISHED to make net code happy */