From ab0d1f0ed7a28866f2fbe2eca7c83843ffeace96 Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Sun, 6 May 2012 20:32:32 -0700 Subject: [PATCH] compat-wireless: add support for CONFIG_HID_GENERIC The HID driver code was moved to a separate module under CONFIG_HID_GENERIC. We remove the old code that had patched support for it given that ifdef'd code around calls to hid_register_driver() and friends given that this was only available on kernels >= 2.6.28. We simply only compile the code in question on newer kernels. Signed-off-by: Luis R. Rodriguez --- config.mk | 1 + patches/16-bluetooth.patch | 48 -------------------------------------- 2 files changed, 1 insertion(+), 48 deletions(-) diff --git a/config.mk b/config.mk index e8ee33382acc..3caebc4c9952 100644 --- a/config.mk +++ b/config.mk @@ -101,6 +101,7 @@ ifeq ($(CONFIG_BT),y) else export CONFIG_COMPAT_BLUETOOTH=y export CONFIG_COMPAT_BLUETOOTH_MODULES=m + export CONFIG_HID_GENERIC=m endif endif #CONFIG_COMPAT_KERNEL_2_6_27 diff --git a/patches/16-bluetooth.patch b/patches/16-bluetooth.patch index 62281268ffb8..e8d29c01e21f 100644 --- a/patches/16-bluetooth.patch +++ b/patches/16-bluetooth.patch @@ -367,54 +367,6 @@ here still, but for now we keep this here. kfree(session); return err; } -@@ -1195,6 +1329,7 @@ int hidp_get_conninfo(struct hidp_connin - return err; - } - -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27)) - static const struct hid_device_id hidp_table[] = { - { HID_BLUETOOTH_DEVICE(HID_ANY_ID, HID_ANY_ID) }, - { } -@@ -1204,6 +1339,7 @@ static struct hid_driver hidp_driver = { - .name = "generic-bluetooth", - .id_table = hidp_table, - }; -+#endif - - static int __init hidp_init(void) - { -@@ -1211,11 +1347,14 @@ static int __init hidp_init(void) - - BT_INFO("HIDP (Human Interface Emulation) ver %s", VERSION); - -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27)) - ret = hid_register_driver(&hidp_driver); - if (ret) - goto err; -+#endif - - ret = hidp_init_sockets(); -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27)) - if (ret) - goto err_drv; - -@@ -1223,13 +1362,16 @@ static int __init hidp_init(void) - err_drv: - hid_unregister_driver(&hidp_driver); - err: -+#endif - return ret; - } - - static void __exit hidp_exit(void) - { - hidp_cleanup_sockets(); -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27)) - hid_unregister_driver(&hidp_driver); -+#endif - } - - module_init(hidp_init); --- a/net/bluetooth/rfcomm/sock.c +++ b/net/bluetooth/rfcomm/sock.c @@ -324,8 +324,13 @@ static struct sock *rfcomm_sock_alloc(st -- 2.30.2