HID: move to_hid_device() to hid.h
authorGeliang Tang <geliangtang@163.com>
Sun, 27 Dec 2015 09:25:20 +0000 (17:25 +0800)
committerJiri Kosina <jkosina@suse.cz>
Mon, 28 Dec 2015 12:41:11 +0000 (13:41 +0100)
to_hid_device() macro is defined in both hid-lg4ff.c and
hid-logitech-hidpp.c. So I move it to include/linux/hid.h.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-lg4ff.c
drivers/hid/hid-logitech-hidpp.c
include/linux/hid.h

index fbddcb37ae982353e433a67d290f9beb12a506b7..3e160ff5f218c020796e307ea6295025bafda49f 100644 (file)
@@ -33,8 +33,6 @@
 #include "hid-lg4ff.h"
 #include "hid-ids.h"
 
-#define to_hid_device(pdev) container_of(pdev, struct hid_device, dev)
-
 #define LG4FF_MMODE_IS_MULTIMODE 0
 #define LG4FF_MMODE_SWITCHED 1
 #define LG4FF_MMODE_NOT_MULTIMODE 2
index f2a481125522e33f912db0455c0b4de21396890c..bd2ab476c65ef9f73a04a1f732dc7f75a3b49835 100644 (file)
@@ -1310,8 +1310,6 @@ struct g920_private_data {
        u16 range;
 };
 
-#define to_hid_device(pdev) container_of(pdev, struct hid_device, dev)
-
 static ssize_t g920_range_show(struct device *dev, struct device_attribute *attr,
                                char *buf)
 {
index a6d7a3fc2cb309990cc0d8418bf13b11df014e31..1472026367ed058b91dc279703388ba0ddfd2b65 100644 (file)
@@ -565,6 +565,9 @@ struct hid_device {                                                 /* device report descriptor */
        wait_queue_head_t debug_wait;
 };
 
+#define to_hid_device(pdev) \
+       container_of(pdev, struct hid_device, dev)
+
 static inline void *hid_get_drvdata(struct hid_device *hdev)
 {
        return dev_get_drvdata(&hdev->dev);