From 589499c04b9929ce3de9a9cc591f8a24cf1ebc91 Mon Sep 17 00:00:00 2001 From: Alessandro Zummo Date: Fri, 28 Mar 2008 14:15:59 -0700 Subject: ixp4xx-beeper: add MODULE_ALIAS The following patch allows ixp4xx-beeper to be loaded by udev automatically when compiled as a module with kernel versions 2.4.24 and greater. This patch is required because 43cc71eed1250755986da4c0f9898f9a635cb3bf ("platform: prefix MODALIAS with "platform:"") changed the modalias string to have the extra prefix. LKG7102D7:~# udevinfo -a -p /sys/devices/platform/ixp4xx-beeper.4 looking at device '/devices/platform/ixp4xx-beeper.4': KERNEL=="ixp4xx-beeper.4" SUBSYSTEM=="platform" DRIVER=="" ATTR{modalias}=="platform:ixp4xx-beeper" udev therefore tries to modprobe platform:ixp4xx-beeper instead of ixp4xx-beeper. LKG7102D7:~# udevtest /sys/devices/platform/ixp4xx-beeper.4 ... import_uevent_var: import into environment: 'PHYSDEVBUS=platform' import_uevent_var: import into environment: 'MODALIAS=platform:ixp4xx-beeper' main: looking at device '/devices/platform/ixp4xx-beeper.4' from subsystem 'platform' wait_for_sysfs: file '/sys/devices/platform/ixp4xx-beeper.4/bus' appeared after 0 loops main: run: 'socket:/org/kernel/udev/monitor' main: run: '/sbin/modprobe --use-blacklist platform:ixp4xx-beeper' With this patch, depmod adds an alias line (see below) to modules.alias which allows modprobe to load the right module. alias platform:ixp4xx-beeper ixp4xx-beeper Signed-off-by: Gordon Farquharson Signed-off-by: Alessandro Zummo Cc: Kay Sievers Cc: David Brownell Cc: Atsushi Nemoto Cc: Greg Kroah-Hartman Cc: Dmitry Torokhov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/input/misc/ixp4xx-beeper.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/input') diff --git a/drivers/input/misc/ixp4xx-beeper.c b/drivers/input/misc/ixp4xx-beeper.c index d2ade7443b7..798d84c44d0 100644 --- a/drivers/input/misc/ixp4xx-beeper.c +++ b/drivers/input/misc/ixp4xx-beeper.c @@ -25,6 +25,7 @@ MODULE_AUTHOR("Alessandro Zummo "); MODULE_DESCRIPTION("ixp4xx beeper driver"); MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:ixp4xx-beeper"); static DEFINE_SPINLOCK(beep_lock); -- cgit v1.2.3 From eb08b6b973cb91311431c6eea3cc232b97152a84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Steinbrink?= Date: Sun, 30 Mar 2008 20:42:59 +0200 Subject: evdev: Release eventual input device grabs when getting disconnected MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When getting disconnected we need to release eventual grabs on the underlying input device as we also release the input device itself. Otherwise, we would try to release the grab when the client that requested it closes its handle, accessing the input device which might already be freed. Signed-off-by: Björn Steinbrink Signed-off-by: Linus Torvalds --- drivers/input/evdev.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/input') diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index 0727b0a1255..99562cee827 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c @@ -853,6 +853,9 @@ static void evdev_cleanup(struct evdev *evdev) evdev_hangup(evdev); evdev_remove_chrdev(evdev); + if (evdev->grab) + evdev_ungrab(evdev, evdev->grab); + /* evdev is marked dead so no one else accesses evdev->open */ if (evdev->open) { input_flush_device(handle, NULL); -- cgit v1.2.3