Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 114428
b: refs/heads/master
c: 02ae9a1
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Slaby authored and Jiri Kosina committed Oct 14, 2008
1 parent f6e4b86 commit 214872d
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8c19a51591d06f5226499972567f528cf6066bb7
refs/heads/master: 02ae9a1a8bc1d08a8fd5f6a0b8bde400b0f891b9
7 changes: 7 additions & 0 deletions trunk/Documentation/feature-removal-schedule.txt
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,13 @@ Who: Glauber Costa <gcosta@redhat.com>

---------------------------

What: remove HID compat support
When: 2.6.29
Why: needed only as a temporary solution until distros fix themselves up
Who: Jiri Slaby <jirislaby@gmail.com>

---------------------------

What: /sys/o2cb symlink
When: January 2010
Why: /sys/fs/o2cb is the proper location for this information - /sys/o2cb
Expand Down
12 changes: 12 additions & 0 deletions trunk/drivers/hid/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,18 @@ source "drivers/hid/usbhid/Kconfig"
menu "Special HID drivers"
depends on HID

config HID_COMPAT
bool "Load all HID drivers on hid core load"
default y
---help---
Compatible option for older userspace. If you have system without udev
support of module loading through aliases and also old
module-init-tools which can't handle hid bus, choose Y here. Otherwise
say N. If you say N and your userspace is old enough, the only
functionality you loose is modules autoloading.

If unsure, say Y.

config HID_APPLE
tristate "Apple"
default m
Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/hid/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ obj-$(CONFIG_HID) += hid.o
hid-$(CONFIG_HID_DEBUG) += hid-debug.o
hid-$(CONFIG_HIDRAW) += hidraw.o

ifdef CONFIG_HID_COMPAT
obj-m += hid-dummy.o
endif

obj-$(CONFIG_HID_APPLE) += hid-apple.o
obj-$(CONFIG_HID_LOGITECH) += hid-logitech.o

Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/hid/hid-apple.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,3 +477,5 @@ static void apple_exit(void)
module_init(apple_init);
module_exit(apple_exit);
MODULE_LICENSE("GPL");

HID_COMPAT_LOAD_DRIVER(apple);
12 changes: 12 additions & 0 deletions trunk/drivers/hid/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1532,6 +1532,14 @@ void hid_unregister_driver(struct hid_driver *hdrv)
}
EXPORT_SYMBOL_GPL(hid_unregister_driver);

#ifdef CONFIG_HID_COMPAT
static void hid_compat_load(struct work_struct *ws)
{
request_module("hid-dummy");
}
static DECLARE_WORK(hid_compat_work, hid_compat_load);
#endif

static int __init hid_init(void)
{
int ret;
Expand All @@ -1546,6 +1554,10 @@ static int __init hid_init(void)
if (ret)
goto err_bus;

#ifdef CONFIG_HID_COMPAT
schedule_work(&hid_compat_work);
#endif

return 0;
err_bus:
bus_unregister(&hid_bus_type);
Expand Down
18 changes: 18 additions & 0 deletions trunk/drivers/hid/hid-dummy.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <linux/autoconf.h>
#include <linux/module.h>
#include <linux/hid.h>

static int __init hid_dummy_init(void)
{
#ifdef CONFIG_HID_APPLE_MODULE
HID_COMPAT_CALL_DRIVER(apple);
#endif
#ifdef CONFIG_HID_LOGITECH_MODULE
HID_COMPAT_CALL_DRIVER(logitech);
#endif

return -EIO;
}
module_init(hid_dummy_init);

MODULE_LICENSE("GPL");
2 changes: 2 additions & 0 deletions trunk/drivers/hid/hid-logitech.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,3 +310,5 @@ static void lg_exit(void)
module_init(lg_init);
module_exit(lg_exit);
MODULE_LICENSE("GPL");

HID_COMPAT_LOAD_DRIVER(logitech);
17 changes: 15 additions & 2 deletions trunk/include/linux/hid.h
Original file line number Diff line number Diff line change
Expand Up @@ -790,10 +790,23 @@ dbg_hid(const char *fmt, ...)
return 0;
}
#define dbg_hid_line dbg_hid
#endif
#endif /* HID_DEBUG */

#define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \
__FILE__ , ## arg)
#endif
#endif /* HID_FF */

#ifdef CONFIG_HID_COMPAT
#define HID_COMPAT_LOAD_DRIVER(name) \
void hid_compat_##name(void) { } \
EXPORT_SYMBOL(hid_compat_##name)
#else
#define HID_COMPAT_LOAD_DRIVER(name)
#endif /* HID_COMPAT */
#define HID_COMPAT_CALL_DRIVER(name) do { \
extern void hid_compat_##name(void); \
hid_compat_##name(); \
} while (0)

#endif

0 comments on commit 214872d

Please sign in to comment.