Driver Core patches for 2.6.14
Subsystems (32)
PATCH 1/1 Driver Core patches for 2.6.14
Here are a lot of driver core patches for 2.6.14. They have all been in the past few -mm releases with no problems. They contain the following things:
- 2 small aoe driver updates
- create hotplug events directly from the sysfs tree so that "coldplug" work at boot time is much simpler.
- add the ability to nest class devices in the driver model
- move the input drivers to have dynamic structures
- move the input subsystem to use the nested class devices
- remove the input core from calling /sbin/hotplug on its own.
- some driver core pm changes
- stop the i2o abuse of the driver model
- some other small things (documentation, bugfixes, etc.)
These patches are needed so that the different distros don't keep trying to keep their own set of "fix up the input subsystem to play nice with /sbin/hotplug" patches that they have been, in order to rely only on udev to handle their hotplug needs. With these changes, they no longer need to do that.
Please pull from:
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6.git/
or if master.kernel.org hasn't synced up yet:
master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6.git/
The full patch set will be sent to the linux-kernel mailing lists, if anyone wants to see them.
thanks,
greg k-h
Documentation/Changes | 2 Documentation/DocBook/writing_usb_driver.tmpl | 3 Documentation/driver-model/driver.txt | 60 -- Documentation/driver-model/porting.txt | 2 arch/arm/common/locomo.c | 10 arch/arm/common/sa1111.c | 11 arch/arm/common/scoop.c | 24 - arch/arm/mach-pxa/corgi_ssp.c | 24 - arch/arm/mach-sa1100/neponset.c | 28 - arch/i386/kernel/cpuid.c | 2 arch/i386/kernel/msr.c | 2 drivers/base/attribute_container.c | 2 drivers/base/base.h | 12 drivers/base/class.c | 152 ++++-- drivers/base/core.c | 21 drivers/base/cpu.c | 1 drivers/base/driver.c | 3 drivers/base/firmware.c | 3 drivers/base/init.c | 10 drivers/base/platform.c | 22 drivers/base/power/sysfs.c | 73 +++ drivers/block/aoe/aoe.h | 2 drivers/block/aoe/aoechr.c | 2 drivers/block/aoe/aoecmd.c | 15 drivers/block/genhd.c | 25 + drivers/block/paride/pg.c | 2 drivers/block/paride/pt.c | 4 drivers/char/dsp56k.c | 2 drivers/char/ftape/zftape/zftape-init.c | 12 drivers/char/ip2main.c | 10 drivers/char/ipmi/ipmi_devintf.c | 2 drivers/char/istallion.c | 3 drivers/char/lp.c | 2 drivers/char/mem.c | 3 drivers/char/misc.c | 2 drivers/char/ppdev.c | 2 drivers/char/raw.c | 4 drivers/char/s3c2410-rtc.c | 20 drivers/char/snsc.c | 2 drivers/char/sonypi.c | 106 ++-- drivers/char/stallion.c | 4 drivers/char/tipar.c | 2 drivers/char/tty_io.c | 10 drivers/char/vc_screen.c | 10 drivers/char/viotape.c | 4 drivers/char/watchdog/s3c2410_wdt.c | 34 - drivers/hwmon/hdaps.c | 6 drivers/hwmon/hwmon.c | 2 drivers/i2c/busses/i2c-s3c2410.c | 8 drivers/i2c/i2c-core.c | 4 drivers/ide/ide-tape.c | 42 + drivers/ieee1394/dv1394.c | 2 drivers/ieee1394/nodemgr.c | 4 drivers/ieee1394/raw1394.c | 2 drivers/ieee1394/video1394.c | 2 drivers/infiniband/core/ucm.c | 2 drivers/input/evdev.c | 26 - drivers/input/input.c | 555 +++++++++++++++---------- drivers/input/joydev.c | 26 - drivers/input/joystick/adi.c | 93 ++-- drivers/input/joystick/amijoy.c | 87 ++- drivers/input/joystick/analog.c | 100 ++-- drivers/input/joystick/cobra.c | 70 +-- drivers/input/joystick/db9.c | 292 +++++++------ drivers/input/joystick/gamecon.c | 396 +++++++++-------- drivers/input/joystick/gf2k.c | 71 +-- drivers/input/joystick/grip.c | 85 ++- drivers/input/joystick/grip_mp.c | 149 +++--- drivers/input/joystick/guillemot.c | 53 +- drivers/input/joystick/iforce/iforce-main.c | 106 ++-- drivers/input/joystick/iforce/iforce-packets.c | 5 drivers/input/joystick/iforce/iforce-serio.c | 10 drivers/input/joystick/iforce/iforce-usb.c | 22 drivers/input/joystick/iforce/iforce.h | 2 drivers/input/joystick/interact.c | 55 +- drivers/input/joystick/magellan.c | 71 +-- drivers/input/joystick/sidewinder.c | 72 +-- drivers/input/joystick/spaceball.c | 82 +-- drivers/input/joystick/spaceorb.c | 78 +-- drivers/input/joystick/stinger.c | 75 +-- drivers/input/joystick/tmdc.c | 324 ++++++++------ drivers/input/joystick/turbografx.c | 223 ++++++---- drivers/input/joystick/twidjoy.c | 118 ++--- drivers/input/joystick/warrior.c | 83 +-- drivers/input/keyboard/amikbd.c | 59 +- drivers/input/keyboard/atkbd.c | 188 ++++---- drivers/input/keyboard/corgikbd.c | 96 ++-- drivers/input/keyboard/lkkbd.c | 126 ++--- drivers/input/keyboard/maple_keyb.c | 76 +-- drivers/input/keyboard/newtonkbd.c | 83 +-- drivers/input/keyboard/spitzkbd.c | 121 ++--- drivers/input/keyboard/sunkbd.c | 117 ++--- drivers/input/keyboard/xtkbd.c | 82 +-- drivers/input/misc/m68kspkr.c | 40 - drivers/input/misc/pcspkr.c | 34 - drivers/input/misc/sparcspkr.c | 45 -- drivers/input/mouse/alps.c | 67 +-- drivers/input/mouse/alps.h | 2 drivers/input/mouse/amimouse.c | 51 +- drivers/input/mouse/inport.c | 96 ++-- drivers/input/mouse/lifebook.c | 16 drivers/input/mouse/logibm.c | 88 ++- drivers/input/mouse/logips2pp.c | 20 drivers/input/mouse/maplemouse.c | 10 drivers/input/mouse/pc110pad.c | 70 +-- drivers/input/mouse/psmouse-base.c | 99 ++-- drivers/input/mouse/psmouse.h | 2 drivers/input/mouse/rpcmouse.c | 43 - drivers/input/mouse/sermouse.c | 84 +-- drivers/input/mouse/synaptics.c | 6 drivers/input/mouse/vsxxxaa.c | 84 +-- drivers/input/mousedev.c | 41 - drivers/input/serio/i8042.c | 13 drivers/input/touchscreen/corgi_ts.c | 131 ++--- drivers/input/touchscreen/elo.c | 89 +--- drivers/input/touchscreen/gunze.c | 66 +- drivers/input/touchscreen/h3600_ts_input.c | 149 ++---- drivers/input/touchscreen/hp680_ts_input.c | 58 +- drivers/input/touchscreen/mk712.c | 80 +-- drivers/input/touchscreen/mtouch.c | 64 +- drivers/input/tsdev.c | 29 - drivers/isdn/capi/capi.c | 2 drivers/macintosh/adb.c | 2 drivers/macintosh/adbhid.c | 220 +++++---- drivers/macintosh/mac_hid.c | 44 + drivers/media/common/ir-common.c | 1 drivers/media/dvb/cinergyT2/cinergyT2.c | 108 +++- drivers/media/dvb/dvb-core/dvbdev.c | 2 drivers/media/dvb/dvb-usb/dvb-usb-remote.c | 50 +- drivers/media/dvb/dvb-usb/dvb-usb.h | 3 drivers/media/dvb/ttpci/av7110_ir.c | 37 - drivers/media/dvb/ttpci/budget-ci.c | 24 - drivers/media/dvb/ttusb-dec/ttusb_dec.c | 51 +- drivers/media/video/bttvp.h | 2 drivers/media/video/cx88/cx88-input.c | 58 +- drivers/media/video/ir-kbd-gpio.c | 52 +- drivers/media/video/ir-kbd-i2c.c | 33 - drivers/media/video/msp3400.c | 8 drivers/media/video/saa7134/saa7134-input.c | 39 - drivers/media/video/saa7134/saa7134.h | 2 drivers/media/video/tda9887.c | 4 drivers/media/video/tuner-core.c | 4 drivers/message/i2o/core.h | 3 drivers/message/i2o/device.c | 326 ++++++-------- drivers/message/i2o/driver.c | 3 drivers/message/i2o/iop.c | 34 - drivers/mfd/mcp-sa11x0.c | 20 drivers/mfd/ucb1x00-ts.c | 45 +- drivers/mmc/pxamci.c | 8 drivers/mmc/wbsd.c | 4 drivers/mtd/maps/sa1100-flash.c | 8 drivers/mtd/mtdchar.c | 4 drivers/net/dm9000.c | 8 drivers/net/irda/sa1100_ir.c | 8 drivers/net/irda/smsc-ircc2.c | 12 drivers/net/phy/mdio_bus.c | 20 drivers/net/ppp_generic.c | 2 drivers/net/smc91x.c | 8 drivers/net/wan/cosa.c | 2 drivers/pci/pci.c | 4 drivers/pci/pcie/portdrv_core.c | 4 drivers/pci/probe.c | 16 drivers/pcmcia/au1000_generic.c | 21 drivers/pcmcia/ds.c | 6 drivers/pcmcia/hd64465_ss.c | 20 drivers/pcmcia/i82365.c | 20 drivers/pcmcia/m32r_cfc.c | 21 drivers/pcmcia/m32r_pcc.c | 21 drivers/pcmcia/omap_cf.c | 18 drivers/pcmcia/pxa2xx_base.c | 26 - drivers/pcmcia/rsrc_nonstatic.c | 6 drivers/pcmcia/sa1100_generic.c | 20 drivers/pcmcia/socket_sysfs.c | 6 drivers/pcmcia/tcic.c | 20 drivers/pcmcia/vrc4171_card.c | 24 - drivers/s390/char/tape_class.c | 1 drivers/s390/char/vmlogrdr.c | 1 drivers/scsi/ch.c | 2 drivers/scsi/osst.c | 2 drivers/scsi/sg.c | 10 drivers/scsi/st.c | 2 drivers/serial/8250.c | 10 drivers/serial/imx.c | 8 drivers/serial/mpc52xx_uart.c | 8 drivers/serial/pxa.c | 8 drivers/serial/s3c2410.c | 9 drivers/serial/sa1100.c | 8 drivers/serial/vr41xx_siu.c | 10 drivers/usb/core/devio.c | 2 drivers/usb/core/file.c | 4 drivers/usb/core/hcd.c | 3 drivers/usb/core/hub.c | 16 drivers/usb/gadget/dummy_hcd.c | 22 drivers/usb/gadget/omap_udc.c | 9 drivers/usb/gadget/pxa2xx_udc.c | 17 drivers/usb/host/isp116x-hcd.c | 14 drivers/usb/host/ohci-omap.c | 10 drivers/usb/host/ohci-pxa27x.c | 4 drivers/usb/host/sl811-hcd.c | 10 drivers/usb/input/acecad.c | 78 +-- drivers/usb/input/aiptek.c | 209 ++++----- drivers/usb/input/appletouch.c | 130 +++-- drivers/usb/input/ati_remote.c | 173 ++++--- drivers/usb/input/hid-core.c | 51 +- drivers/usb/input/hid-input.c | 58 +- drivers/usb/input/hid-lgff.c | 17 drivers/usb/input/hid-tmff.c | 11 drivers/usb/input/hid.h | 2 drivers/usb/input/itmtouch.c | 72 +-- drivers/usb/input/kbtab.c | 86 +-- drivers/usb/input/keyspan_remote.c | 214 ++++----- drivers/usb/input/mtouchusb.c | 111 ++--- drivers/usb/input/pid.c | 12 drivers/usb/input/powermate.c | 136 +++--- drivers/usb/input/touchkitusb.c | 116 ++--- drivers/usb/input/usbkbd.c | 105 ++-- drivers/usb/input/usbmouse.c | 97 ++-- drivers/usb/input/wacom.c | 142 ++---- drivers/usb/input/xpad.c | 97 +--- drivers/usb/input/yealink.c | 66 +- drivers/usb/media/konicawc.c | 89 ++-- drivers/usb/storage/onetouch.c | 105 ++-- drivers/video/backlight/corgi_bl.c | 10 drivers/video/fbmem.c | 2 drivers/video/imxfb.c | 10 drivers/video/pxafb.c | 10 drivers/video/s1d13xxxfb.c | 7 drivers/video/s3c2410fb.c | 29 - drivers/video/sa1100fb.c | 10 drivers/video/w100fb.c | 48 +- fs/coda/psdev.c | 4 fs/partitions/check.c | 27 + include/linux/device.h | 115 ++--- include/linux/genhd.h | 1 include/linux/i2o.h | 4 include/linux/input.h | 28 + include/linux/kobject.h | 2 include/linux/pm.h | 26 + lib/kobject.c | 2 lib/kobject_uevent.c | 8 net/bluetooth/hidp/core.c | 13 sound/arm/pxa2xx-ac97.c | 8 sound/core/init.c | 14 sound/core/sound.c | 2 sound/oss/soundcard.c | 4 sound/pci/ac97/ac97_bus.c | 6 sound/ppc/beep.c | 68 +-- sound/sound_core.c | 2 248 files changed, 5702 insertions(+), 5318 deletions(-)
Ben Dooks:
drivers/base - fix sparse warnings
David Brownell:
pci device wakeup flags
driver model wakeup flags
usb device wakeup flags
Dmitry Torokhov:
Driver core: pass interface to class interface methods Driver core: send hotplug event before adding class interfaces
I2O: remove i2o_device_class
I2O: remove class interface
Input: prepare to sysfs integration drivers/input/mouse: convert to dynamic input_dev allocation
Input: kill devfs references
Input: convert sonypi to dynamic input_dev allocation
Input: convert ucb1x00-ts to dynamic input_dev allocation drivers/input/keyboard: convert to dynamic input_dev allocation
Input: convert onetouch to dynamic input_dev allocation drivers/input/touchscreen: convert to dynamic input_dev allocation drivers/usb/input: convert to dynamic input_dev allocation
Input: convert driver/input/misc to dynamic input_dev allocation
Input: convert net/bluetooth to dynamic input_dev allocation
Input: convert konicawc to dynamic input_dev allocation drivers/input/joystick: convert to dynamic input_dev allocation
Input: convert drivers/macintosh to dynamic input_dev allocation
Input: convert sound/ppc/beep to dynamic input_dev allocation drivers/media: convert to dynamic input_dev allocation
Input: show sysfs path in /proc/bus/input/devices
Input: export input_dev data via sysfs attributes input core: remove custom-made hotplug handler
Ed L Cashin:
aoe: update to version 14
aoe: use get_unaligned for accesses in ATA id buffer
Erik Hovland:
kobject_uevent.c has a typo in a comment
changes device to driver in porting.txt
Greg Kroah-Hartman:
I2O: Clean up some pretty bad driver model abuses in the i2o code Driver Core: add the ability for class_device structures to be nested Driver Core: fix up all callers of class_device_create() Driver Core: document struct class_device properly
INPUT: remove the input_class structure, as it is unused.
INPUT: export input_dev_class so that input drivers can use it.
INPUT: Fix oops when accessing sysfs files of nested input devices
INPUT: register the input class device sooner
INPUT: move the input class devices under their new input_dev devices
INPUT: rename input_dev_class to input_class to be correct. update required version of udev
INPUT: Create symlinks for backwards compatibility
Jesper Juhl:
Driver Core: Big kfree NULL check cleanup - Documentation
Kay Sievers:
add sysfs attr to re-emit device hotplug event
Randy Dunlap:
kobject: fix gfp flags type
kernel-doc: drivers/base fixes
Russell King:
DRIVER MODEL: Get rid of the obsolete tri-level suspend/resume callbacks
Will Dyson:
add sysfs support for ide tape
PATCH 1/1 kobject_uevent.c has a typo in a comment
In reply to Greg KH[PATCH] kobject_uevent.c has a typo in a comment
This patch changes trough to through in a comment in kobject_uevent.c.
---
commit 3ab05c2cd849f4fdee6e79cc9f63d11de6ad63d9
tree 4b60b003d447d63a370564a7059ed2b91b7f119f
parent e801e49d1ca90da1ab0286a3688f2465cb1e45e4
author Erik Hovland <[email protected]> Thu, 06 Oct 2005 10:45:30 -0700 committer Greg Kroah-Hartman <[email protected]> Thu, 27 Oct 2005 22:47:59 -0700
lib/kobject_uevent.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
lib/kobject_uevent.c +1 -1
@@ -54,7 +54,7 @@ static char *action_to_string(enum kobjestatic struct sock *uevent_sock;/** -* send_uevent - notify userspace by sending event trough netlink socket +* send_uevent - notify userspace by sending event through netlink socket * * @signal: signal name * @obj: object path (kobject)
PATCH 1/1 changes device to driver in porting.txt
[PATCH] changes device to driver in porting.txt
The document porting.txt in Documentation/driver-model says:
When a device is successfully bound to a device
I think it should say:
When a device is successfully bound to a driver
---
commit 3da2cf413a832ae4f7691d299f2d7dab30654ce5
tree 1808e0383651b708d22038756f87796b5806a9fc
parent 3ab05c2cd849f4fdee6e79cc9f63d11de6ad63d9
author Erik Hovland <[email protected]> Thu, 06 Oct 2005 10:47:49 -0700 committer Greg Kroah-Hartman <[email protected]> Thu, 27 Oct 2005 22:47:59 -0700
Documentation/driver-model/porting.txt | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Documentation/driver-model/porting.txt +1 -1
@@ -350,7 +350,7 @@ When a driver is registered, the bus's l over. bus->match() is called for each device that is not already claimed by a driver. -When a device is successfully bound to a device, device->driver is +When a device is successfully bound to a driver, device->driver is set, the device is added to a per-driver list of devices, and a symlink is created in the driver's sysfs directory that points to the device's physical directory:
PATCH 1/1 aoe: update to version 14
In reply to Greg KH[PATCH] aoe: update to version 14
Update driver version number to 14.
---
commit 271c0df6e700b3f208b1802a1e96bb9eeeaa880c
tree 9ef2a3d1fff7584bf8ffc4513500e4af580d2fb7
parent 786fbf6c1eb91e7e70a1ef42ff2523aff0f09850
author Ed L. Cashin <[email protected]> Thu, 29 Sep 2005 12:47:55 -0400 committer Greg Kroah-Hartman <[email protected]> Thu, 27 Oct 2005 22:47:58 -0700
drivers/block/aoe/aoe.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/block/aoe/aoe.h +1 -1
@@ -1,5 +1,5 @@/* Copyright (c) 2004 Coraid, Inc. See COPYING for GPL terms. */ -#define VERSION "12" +#define VERSION "14"#define AOE_MAJOR 152#define DEVICE_NAME "aoe"
PATCH 1/1 Input: kill devfs references
In reply to Greg KH[PATCH] Input: kill devfs references
Input: remove references to devfs from input subsystem
---
commit f2e28e004f12e0e3fd1edf3ca1f35b42ab45988f
tree c460ec846a36705836ba7f641a610a161f3a7996
parent e9a873633c67dd048c9d53f3e934e83df10312d1
author Dmitry Torokhov <[email protected]> Thu, 15 Sep 2005 02:01:38 -0500 committer Greg Kroah-Hartman <[email protected]> Thu, 27 Oct 2005 22:48:03 -0700
drivers/input/evdev.c | 4 ---- drivers/input/input.c | 7 ------- drivers/input/joydev.c | 4 ---- drivers/input/mousedev.c | 9 +-------- drivers/input/tsdev.c | 7 ------- 5 files changed, 1 insertions(+), 30 deletions(-)
drivers/input/evdev.c +0 -4
@@ -20,7 +20,6 @@#include <linux/major.h> #include <linux/smp_lock.h> #include <linux/device.h> -#include <linux/devfs_fs_kernel.h> #include <linux/compat.h> struct evdev {
@@ -687,8 +686,6 @@ static struct input_handle *evdev_connec evdev_table[minor] = evdev; -devfs_mk_cdev (MKDEV (INPUT_MAJOR ,EVDEV_MINOR_BASE + minor), -S_IFCHR |S_IRUGO |S_IWUSR ,"input/event%d" , minor);class_device_create (input_class,NULL ,MKDEV (INPUT_MAJOR ,EVDEV_MINOR_BASE + minor), dev->dev,"event%d" , minor);
@@ -703,7 +700,6 @@ static void evdev_disconnect(struct inpuclass_device_destroy (input_class,MKDEV (INPUT_MAJOR ,EVDEV_MINOR_BASE + evdev->minor)); -devfs_remove ("input/event%d" , evdev->minor); evdev->exist =0 ;if (evdev->open) {
drivers/input/input.c +0 -7
@@ -22,7 +22,6 @@#include <linux/interrupt.h> #include <linux/poll.h> #include <linux/device.h> -#include <linux/devfs_fs_kernel.h> MODULE_AUTHOR ("Vojtech Pavlik <[email protected]>" );MODULE_DESCRIPTION ("Input core" );
@@ -770,13 +769,8 @@ static int __init input_init(void) goto fail2; } - err =devfs_mk_dir ("input" ); -if (err) - goto fail3; -return 0 ; - fail3:unregister_chrdev (INPUT_MAJOR ,"input" ); fail2:input_proc_exit (); fail1:class_destroy (input_class);return err;
@@ -785,7 +779,6 @@ static int __init input_init(void) static void __exit input_exit(void) {input_proc_exit (); -devfs_remove ("input" );unregister_chrdev (INPUT_MAJOR ,"input" );class_destroy (input_class); }
drivers/input/joydev.c +0 -4
@@ -26,7 +26,6 @@#include <linux/init.h> #include <linux/smp_lock.h> #include <linux/device.h> -#include <linux/devfs_fs_kernel.h> MODULE_AUTHOR ("Vojtech Pavlik <[email protected]>" );MODULE_DESCRIPTION ("Joystick device interfaces" );
@@ -514,8 +513,6 @@ static struct input_handle *joydev_conne joydev_table[minor] = joydev; -devfs_mk_cdev (MKDEV (INPUT_MAJOR ,JOYDEV_MINOR_BASE + minor), -S_IFCHR |S_IRUGO |S_IWUSR ,"input/js%d" , minor);class_device_create (input_class,NULL ,MKDEV (INPUT_MAJOR ,JOYDEV_MINOR_BASE + minor), dev->dev,"js%d" , minor);
@@ -529,7 +526,6 @@ static void joydev_disconnect(struct inpstruct joydev_list *list;class_device_destroy (input_class,MKDEV (INPUT_MAJOR ,JOYDEV_MINOR_BASE + joydev->minor)); -devfs_remove ("input/js%d" , joydev->minor); joydev->exist =0 ;if (joydev->open) {
drivers/input/mousedev.c +1 -8
@@ -9,7 +9,7 @@* the Free Software Foundation. */ -#define MOUSEDEV_MINOR_BASE 32 +#define MOUSEDEV_MINOR_BASE 32#define MOUSEDEV_MINORS 32#define MOUSEDEV_MIX 31
@@ -24,7 +24,6 @@#include <linux/random.h> #include <linux/major.h> #include <linux/device.h> -#include <linux/devfs_fs_kernel.h> #ifdef CONFIG_INPUT_MOUSEDEV_PSAUX #include <linux/miscdevice.h> #endif
@@ -649,8 +648,6 @@ static struct input_handle *mousedev_con mousedev_table[minor] = mousedev; -devfs_mk_cdev (MKDEV (INPUT_MAJOR ,MOUSEDEV_MINOR_BASE + minor), -S_IFCHR |S_IRUGO |S_IWUSR ,"input/mouse%d" , minor);class_device_create (input_class,NULL ,MKDEV (INPUT_MAJOR ,MOUSEDEV_MINOR_BASE + minor), dev->dev,"mouse%d" , minor);
@@ -665,7 +662,6 @@ static void mousedev_disconnect(struct iclass_device_destroy (input_class,MKDEV (INPUT_MAJOR ,MOUSEDEV_MINOR_BASE + mousedev->minor)); -devfs_remove ("input/mouse%d" , mousedev->minor); mousedev->exist =0 ;if (mousedev->open) {
@@ -738,8 +734,6 @@ static int __init mousedev_init(void) mousedev_mix.exist =1 ; mousedev_mix.minor =MOUSEDEV_MIX ; -devfs_mk_cdev (MKDEV (INPUT_MAJOR ,MOUSEDEV_MINOR_BASE +MOUSEDEV_MIX ), -S_IFCHR |S_IRUGO |S_IWUSR ,"input/mice" );class_device_create (input_class,NULL ,MKDEV (INPUT_MAJOR ,MOUSEDEV_MINOR_BASE +MOUSEDEV_MIX ),NULL ,"mice" );
@@ -759,7 +753,6 @@ static void __exit mousedev_exit(void)if (psaux_registered)misc_deregister (&psaux_mouse);#endif -devfs_remove ("input/mice" );class_device_destroy (input_class,MKDEV (INPUT_MAJOR ,MOUSEDEV_MINOR_BASE +MOUSEDEV_MIX ));input_unregister_handler (&mousedev_handler);
drivers/input/tsdev.c +0 -7
@@ -53,7 +53,6 @@#include <linux/random.h> #include <linux/time.h> #include <linux/device.h> -#include <linux/devfs_fs_kernel.h> #ifndef CONFIG_INPUT_TSDEV_SCREEN_X #define CONFIG_INPUT_TSDEV_SCREEN_X 240
@@ -410,10 +409,6 @@ static struct input_handle *tsdev_connec tsdev_table[minor] = tsdev; -devfs_mk_cdev (MKDEV (INPUT_MAJOR ,TSDEV_MINOR_BASE + minor), -S_IFCHR |S_IRUGO |S_IWUSR ,"input/ts%d" , minor); -devfs_mk_cdev (MKDEV (INPUT_MAJOR ,TSDEV_MINOR_BASE + minor +TSDEV_MINORS /2 ), -S_IFCHR |S_IRUGO |S_IWUSR ,"input/tsraw%d" , minor);class_device_create (input_class,NULL ,MKDEV (INPUT_MAJOR ,TSDEV_MINOR_BASE + minor), dev->dev,"ts%d" , minor);
@@ -428,8 +423,6 @@ static void tsdev_disconnect(struct inpuclass_device_destroy (input_class,MKDEV (INPUT_MAJOR ,TSDEV_MINOR_BASE + tsdev->minor)); -devfs_remove ("input/ts%d" , tsdev->minor); -devfs_remove ("input/tsraw%d" , tsdev->minor); tsdev->exist =0 ;if (tsdev->open) {
PATCH 1/1 Input: convert sonypi to dynamic input_dev allocation
[PATCH] Input: convert sonypi to dynamic input_dev allocation
Input: convert sonypi to dynamic input_dev allocation
This is required for input_dev sysfs integration
---
commit 218e51d8b7c75a09e156696c037e6e3383a7808b
tree 5ac0471cac3b7fe7214d5d94d1017b9be81c0416
parent a7827f4a9186387c432f3c802ea6330396d83eb9
author Dmitry Torokhov <[email protected]> Thu, 15 Sep 2005 02:01:50 -0500 committer Greg Kroah-Hartman <[email protected]> Thu, 27 Oct 2005 22:48:04 -0700
drivers/char/sonypi.c | 92 ++++++++++++++++++++++++++++--------------------- 1 files changed, 53 insertions(+), 39 deletions(-)
drivers/char/sonypi.c +53 -39
@@ -424,10 +424,6 @@ static struct sonypi_eventtypes {#define SONYPI_BUF_SIZE 128 -/* The name of the devices for the input device drivers */ -#define SONYPI_JOG_INPUTNAME "Sony Vaio Jogdial" -#define SONYPI_KEY_INPUTNAME "Sony Vaio Keys" -/* Correspondance table between sonypi events and input layer events */ static struct { int sonypiev;
@@ -490,8 +486,8 @@ static struct sonypi_device {struct fasync_struct *fifo_async;int open_count;int model; -struct input_dev input_jog_dev; -struct input_dev input_key_dev; +struct input_dev *input_jog_dev; +struct input_dev *input_key_dev;struct work_struct input_work;struct kfifo *input_fifo;spinlock_t input_fifo_lock;
@@ -779,8 +775,8 @@ static void input_keyrelease(void *data)static void sonypi_report_input_event (u8 event) { -struct input_dev *jog_dev = &sonypi_device.input_jog_dev; -struct input_dev *key_dev = &sonypi_device.input_key_dev; +struct input_dev *jog_dev = sonypi_device.input_jog_dev; +struct input_dev *key_dev = sonypi_device.input_key_dev;struct sonypi_keypress kp = {NULL };int i;
@@ -1203,6 +1199,47 @@ static struct device_driver sonypi_drive .shutdown = sonypi_shutdown, }; +static int __devinit sonypi_create_input_devices (void ) +{ +struct input_dev *jog_dev; +struct input_dev *key_dev; +int i; + + sonypi_device.input_jog_dev = jog_dev =input_allocate_device (); +if (!jog_dev) +return -ENOMEM ; + + jog_dev->name ="Sony Vaio Jogdial" ; + jog_dev->id.bustype =BUS_ISA ; + jog_dev->id.vendor =PCI_VENDOR_ID_SONY ; + + jog_dev->evbit[0 ] =BIT (EV_KEY ) |BIT (EV_REL ); + jog_dev->keybit[LONG (BTN_MOUSE )] =BIT (BTN_MIDDLE ); + jog_dev->relbit[0 ] =BIT (REL_WHEEL ); + + sonypi_device.input_key_dev = key_dev =input_allocate_device (); +if (!key_dev) { +input_free_device (jog_dev); + sonypi_device.input_jog_dev =NULL ; +return -ENOMEM ; + } + + key_dev->name ="Sony Vaio Keys" ; + key_dev->id.bustype =BUS_ISA ; + key_dev->id.vendor =PCI_VENDOR_ID_SONY ; + +/* Initialize the Input Drivers: special keys */ + key_dev->evbit[0 ] =BIT (EV_KEY ); +for (i =0 ; sonypi_inputkeys[i].sonypiev; i++) +if (sonypi_inputkeys[i].inputev) +set_bit (sonypi_inputkeys[i].inputev, key_dev->keybit); + +input_register_device (jog_dev); +input_register_device (key_dev); + +return 0 ; +} +static int __devinit sonypi_probe (void ) {int i, ret;
@@ -1298,34 +1335,10 @@ static int __devinit sonypi_probe(void) }if (useinput) { -/* Initialize the Input Drivers: jogdial */ -int i; - sonypi_device.input_jog_dev.evbit[0 ] = -BIT (EV_KEY ) |BIT (EV_REL ); - sonypi_device.input_jog_dev.keybit[LONG (BTN_MOUSE )] = -BIT (BTN_MIDDLE ); - sonypi_device.input_jog_dev.relbit[0 ] =BIT (REL_WHEEL ); - sonypi_device.input_jog_dev.name =SONYPI_JOG_INPUTNAME ; - sonypi_device.input_jog_dev.id.bustype =BUS_ISA ; - sonypi_device.input_jog_dev.id.vendor =PCI_VENDOR_ID_SONY ; - -input_register_device (&sonypi_device.input_jog_dev); -printk (KERN_INFO "%s input method installed.\n" , - sonypi_device.input_jog_dev.name); -/* Initialize the Input Drivers: special keys */ - sonypi_device.input_key_dev.evbit[0 ] =BIT (EV_KEY ); -for (i =0 ; sonypi_inputkeys[i].sonypiev; i++) -if (sonypi_inputkeys[i].inputev) -set_bit (sonypi_inputkeys[i].inputev, - sonypi_device.input_key_dev.keybit); - sonypi_device.input_key_dev.name =SONYPI_KEY_INPUTNAME ; - sonypi_device.input_key_dev.id.bustype =BUS_ISA ; - sonypi_device.input_key_dev.id.vendor =PCI_VENDOR_ID_SONY ; - -input_register_device (&sonypi_device.input_key_dev); -printk (KERN_INFO "%s input method installed.\n" , - sonypi_device.input_key_dev.name); + ret =sonypi_create_input_devices (); +if (ret) + goto out_inputdevices;spin_lock_init (&sonypi_device.input_fifo_lock); sonypi_device.input_fifo =
@@ -1375,8 +1388,9 @@ static int __devinit sonypi_probe(void) out_platformdev:kfifo_free (sonypi_device.input_fifo); out_infifo: -input_unregister_device (&sonypi_device.input_key_dev); -input_unregister_device (&sonypi_device.input_jog_dev); +input_unregister_device (sonypi_device.input_key_dev); +input_unregister_device (sonypi_device.input_jog_dev); +out_inputdevices:free_irq (sonypi_device.irq, sonypi_irq); out_reqirq:release_region (sonypi_device.ioport1, sonypi_device.region_size);
@@ -1402,8 +1416,8 @@ static void __devexit sonypi_remove(voidplatform_device_unregister (sonypi_device.pdev);if (useinput) { -input_unregister_device (&sonypi_device.input_key_dev); -input_unregister_device (&sonypi_device.input_jog_dev); +input_unregister_device (sonypi_device.input_key_dev); +input_unregister_device (sonypi_device.input_jog_dev);kfifo_free (sonypi_device.input_fifo); }
PATCH 1/1 kobject: fix gfp flags type
In reply to Greg KH[PATCH] kobject: fix gfp flags type
Fix implicit nocast warnings in kobject_uevent code, including __nocast:lib/kobject_uevent.c:78:37: warning: implicit cast to nocast type lib/kobject_uevent.c:97:51: warning: implicit cast to nocast type lib/kobject_uevent.c:120:27: warning: implicit cast to nocast type
---
commit 409d93787e8cfec603d512c2925f8580c32a9d0a
tree 7ee455a735b293d329e1921f5dd6e565644817c7
parent 3da2cf413a832ae4f7691d299f2d7dab30654ce5
author Randy Dunlap <[email protected]> Tue, 04 Oct 2005 00:45:34 -0700 committer Greg Kroah-Hartman <[email protected]> Thu, 27 Oct 2005 22:47:59 -0700
include/linux/kobject.h | 2 +- lib/kobject.c | 2 +- lib/kobject_uevent.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-)
include/linux/kobject.h +1 -1
@@ -65,7 +65,7 @@ extern void kobject_unregister(struct koextern struct kobject *kobject_get (struct kobject *);extern void kobject_put (struct kobject *); -extern char *kobject_get_path (struct kobject *,int ); +extern char *kobject_get_path (struct kobject *,unsigned int __nocast );struct kobj_type {void (*release)(struct kobject *);
lib/kobject.c +1 -1
@@ -100,7 +100,7 @@ static void fill_kobj_path(struct kobjec* @kobj: kobject in question, with which to build the path * @gfp_mask: the allocation type used to allocate the path */ -char *kobject_get_path (struct kobject *kobj,int gfp_mask) +char *kobject_get_path (struct kobject *kobj,unsigned int __nocast gfp_mask) {char *path;int len;
lib/kobject_uevent.c +3 -3
@@ -62,7 +62,7 @@ static struct sock *uevent_sock;* @gfp_mask: */ static int send_uevent (const char *signal,const char *obj, -char **envp,int gfp_mask) +char **envp,unsigned int __nocast gfp_mask) {struct sk_buff *skb;char *pos;
@@ -98,7 +98,7 @@ static int send_uevent(const char *signa }static int do_kobject_uevent (struct kobject *kobj,enum kobject_action action, -struct attribute *attr,int gfp_mask) +struct attribute *attr,unsigned int __nocast gfp_mask) {char *path;char *attrpath;
@@ -170,7 +170,7 @@ postcore_initcall(kobject_uevent_init);#else static inline int send_uevent (const char *signal,const char *obj, -char **envp,int gfp_mask) +char **envp,unsigned int __nocast gfp_mask) {return 0 ; }
PATCH 1/1 Driver core: send hotplug event before adding class interfaces
In reply to Greg KH[PATCH] Driver core: send hotplug event before adding class interfaces
Move call to kobject_hotplug() above code that adds interfaces to a class device, otherwise children's hotplug events may reach userspace first.
---
commit 85a44726f49989a2647cd850d55ec5be75727c5b
tree f9d837c5fb3f70626ea55bbb522c485be79b2039
parent 454a289c5bc26384c2bdc40c0d232cf47bcf0a5d
author Dmitry Torokhov <[email protected]> Thu, 15 Sep 2005 02:01:37 -0500 committer Greg Kroah-Hartman <[email protected]> Thu, 27 Oct 2005 22:48:00 -0700
drivers/base/class.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/base/class.c +2 -1
@@ -524,6 +524,8 @@ int class_device_add(struct class_device class_name); } +kobject_hotplug (&class_dev->kobj,KOBJ_ADD ); +/* notify any interfaces this device is now here */ if (parent) {down (&parent->sem);
@@ -533,7 +535,6 @@ int class_device_add(struct class_device class_intf->add (class_dev);up (&parent->sem); } -kobject_hotplug (&class_dev->kobj,KOBJ_ADD ); register_done:if (error && parent)
PATCH 1/1 pci device wakeup flags
In reply to Greg KH[PATCH] pci device wakeup flags
This patch teaches "pci_dev" about the new driver model wakeup support:
- It marks devices as supporting wakeup when "can issue PME#" is listed in its PCI PM capability.
- pci_enable_wake() refuses to enable wake if that's been disabled (e.g. through sysfs).
NOTE that a recent patch changed PCI probing, and this reverts part of that change ... so that driver model initialization is again done before the PCI setup.
(One issue is that the driver model "init + add == register" pattern isn't being used inside PCI ... and that probe change worsened the problem by making "add" do some "init" too. Maybe PCI should match the driver model more closely, and just grow a new "pci_dev_init" function.)
---
commit 454a289c5bc26384c2bdc40c0d232cf47bcf0a5d
tree e012cb9ddae22f2bb7fba37b6834e2123070eaa0
parent f69079c91f8ade0bb306d137d60cc9892e89f35a
author David Brownell <[email protected]> Mon, 12 Sep 2005 19:48:14 -0700 committer Greg Kroah-Hartman <[email protected]> Thu, 27 Oct 2005 22:47:59 -0700
drivers/pci/pci.c | 4 ++++ drivers/pci/probe.c | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 1 deletions(-)
drivers/pci/pci.c +4 -0
@@ -539,6 +539,10 @@ int pci_enable_wake(struct pci_dev *dev,if (!pm)return enable ? -EIO :0 ; +/* don't enable unless policy set through driver core allows it */ +if (!device_may_wakeup (&dev->dev) && enable) +return -EROFS ; +/* Check device's ability to generate PME# */ pci_read_config_word (dev,pm+PCI_PM_PMC ,&value);
drivers/pci/probe.c +15 -1
@@ -589,6 +589,7 @@ static void pci_read_irq(struct pci_devstatic int pci_setup_device (struct pci_dev * dev) {u32 class; +u16 pm;sprintf (pci_name (dev),"%04x:%02x:%02x.%d" ,pci_domain_nr (dev->bus), dev->bus->number,PCI_SLOT (dev->devfn),PCI_FUNC (dev->devfn));
@@ -616,6 +617,19 @@ static int pci_setup_device(struct pci_dpci_read_bases (dev,6 ,PCI_ROM_ADDRESS );pci_read_config_word (dev,PCI_SUBSYSTEM_VENDOR_ID , &dev->subsystem_vendor);pci_read_config_word (dev,PCI_SUBSYSTEM_ID , &dev->subsystem_device); + +/* PCI PM capable devices may be able to issue PME# (wakeup) */ + pm =pci_find_capability (dev,PCI_CAP_ID_PM ); +if (pm) { +pci_read_config_word (dev, pm +PCI_PM_PMC , &pm); +if (pm &PCI_PM_CAP_PME_MASK ) +device_init_wakeup (&dev->dev,1 ); + +/* REVISIT: if (pm & PCI_PM_CAP_PME_D3cold) then +* pci pm spec 1.2, section 3.2.4 says we should +* init PCI_PM_CTRL_PME_{STATUS,ENABLE} ... +*/ + }break ;case PCI_HEADER_TYPE_BRIDGE :/* bridge header */
@@ -755,6 +769,7 @@ pci_scan_device(struct pci_bus *bus, intmemset (dev,0 ,sizeof (struct pci_dev )); dev->bus = bus; dev->sysdata = bus->sysdata; +device_initialize (&dev->dev); dev->dev.parent = bus->bridge; dev->dev.bus = &pci_bus_type; dev->devfn = devfn;
@@ -777,7 +792,6 @@ pci_scan_device(struct pci_bus *bus, intvoid __devinit pci_device_add (struct pci_dev *dev,struct pci_bus *bus) { -device_initialize (&dev->dev); dev->dev.release = pci_release_dev;pci_dev_get (dev);
PATCH 1/1 usb device wakeup flags
In reply to Greg KH[PATCH] usb device wakeup flags
This patch teaches "usb_device" about the new driver model wakeup support:
- It updates device wakeup capabilities when entering a configuration with the WAKEUP attribute;
- During suspend processing it consults the policy bit to see whether it should enable wakeup for that device. (This resolves a FIXME to not assume the answer is always "yes"; some devices lie about supporting remote wakeup.)
Support for root hubs and the HCDs is separate (and more complex).
---
commit f69079c91f8ade0bb306d137d60cc9892e89f35a
tree 40b0e76157521b9c422267c7c6d693be16e93e77
parent 79eef3cfd105168a2115fff06971af8efa27db82
author David Brownell <[email protected]> Mon, 12 Sep 2005 19:39:39 -0700 committer Greg Kroah-Hartman <[email protected]> Thu, 27 Oct 2005 22:47:59 -0700
drivers/usb/core/hub.c | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-)
drivers/usb/core/hub.c +9 -7
@@ -1020,9 +1020,15 @@ void usb_set_device_state(struct usb_devspin_lock_irqsave (&device_state_lock, flags);if (udev->state ==USB_STATE_NOTATTACHED ) ;/* do nothing */ -else if (new_state !=USB_STATE_NOTATTACHED ) +else if (new_state !=USB_STATE_NOTATTACHED ) { udev->state = new_state; -else +if (new_state ==USB_STATE_CONFIGURED ) +device_init_wakeup (&udev->dev, + (udev->actconfig->desc.bmAttributes + &USB_CONFIG_ATT_WAKEUP )); +else if (new_state !=USB_STATE_SUSPENDED ) +device_init_wakeup (&udev->dev,0 ); + }else recursively_mark_NOTATTACHED (udev);spin_unlock_irqrestore (&device_state_lock, flags); }
@@ -1546,11 +1552,7 @@ static int hub_port_suspend(struct usb_h* NOTE: OTG devices may issue remote wakeup (or SRP) even when * we don't explicitly enable it here. */ -if (udev->actconfig -// && FIXME (remote wakeup enabled on this bus) -// ... currently assuming it's always appropriate - && (udev->actconfig->desc.bmAttributes - &USB_CONFIG_ATT_WAKEUP ) !=0 ) { +if (device_may_wakeup (&udev->dev)) { status = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), USB_REQ_SET_FEATURE, USB_RECIP_DEVICE, USB_DEVICE_REMOTE_WAKEUP, 0,
PATCH 1/1 Input: convert ucb1x00-ts to dynamic input_dev allocation
In reply to Greg KH[PATCH] Input: convert ucb1x00-ts to dynamic input_dev allocation
Input: convert ucb1x00-ts to dynamic input_dev allocation
This is required for input_dev sysfs integration
---
commit 61ae45fa4a9d1637a430965ee3743c1c42f07268
tree 95ecb6c67d8ebcbab9f2f8113472d7a6b0483c9d
parent b991fee057c50e098677f57b49c848f81b697b14
author Dmitry Torokhov <[email protected]> Thu, 15 Sep 2005 02:01:48 -0500 committer Greg Kroah-Hartman <[email protected]> Thu, 27 Oct 2005 22:48:04 -0700
drivers/mfd/ucb1x00-ts.c | 45 +++++++++++++++++++++++++-------------------- 1 files changed, 25 insertions(+), 20 deletions(-)
drivers/mfd/ucb1x00-ts.c +25 -20
@@ -40,7 +40,7 @@struct ucb1x00_ts { -struct input_dev idev; +struct input_dev *idev;struct ucb1x00 *ucb;wait_queue_head_t irq_wait;
@@ -56,16 +56,16 @@ static int adcsync;static inline void ucb1x00_ts_evt_add (struct ucb1x00_ts *ts,u16 pressure,u16 x,u16 y) { -input_report_abs (&ts->idev,ABS_X , x); -input_report_abs (&ts->idev,ABS_Y , y); -input_report_abs (&ts->idev,ABS_PRESSURE , pressure); -input_sync (&ts->idev); +input_report_abs (ts->idev,ABS_X , x); +input_report_abs (ts->idev,ABS_Y , y); +input_report_abs (ts->idev,ABS_PRESSURE , pressure); +input_sync (ts->idev); }static inline void ucb1x00_ts_event_release (struct ucb1x00_ts *ts) { -input_report_abs (&ts->idev,ABS_PRESSURE ,0 ); -input_sync (&ts->idev); +input_report_abs (ts->idev,ABS_PRESSURE ,0 ); +input_sync (ts->idev); }/*
@@ -341,26 +341,30 @@ static int ucb1x00_ts_add(struct ucb1x00 {struct ucb1x00_ts *ts; - ts =kmalloc (sizeof (struct ucb1x00_ts ),GFP_KERNEL ); + ts =kzalloc (sizeof (struct ucb1x00_ts ),GFP_KERNEL );if (!ts)return -ENOMEM ; -memset (ts,0 ,sizeof (struct ucb1x00_ts )); + ts->idev =input_allocate_device (); +if (!ts->idev) { +kfree (ts); +return -ENOMEM ; + } ts->ucb = dev->ucb; ts->adcsync = adcsync ?UCB_SYNC :UCB_NOSYNC ; - ts->idev.name ="Touchscreen panel" ; - ts->idev.id.product = ts->ucb->id; - ts->idev.open = ucb1x00_ts_open; - ts->idev.close = ucb1x00_ts_close; - -__set_bit (EV_ABS , ts->idev.evbit); -__set_bit (ABS_X , ts->idev.absbit); -__set_bit (ABS_Y , ts->idev.absbit); -__set_bit (ABS_PRESSURE , ts->idev.absbit); + ts->idev->name ="Touchscreen panel" ; + ts->idev->id.product = ts->ucb->id; + ts->idev->open = ucb1x00_ts_open; + ts->idev->close = ucb1x00_ts_close; + +__set_bit (EV_ABS , ts->idev->evbit); +__set_bit (ABS_X , ts->idev->absbit); +__set_bit (ABS_Y , ts->idev->absbit); +__set_bit (ABS_PRESSURE , ts->idev->absbit); -input_register_device (&ts->idev); +input_register_device (ts->idev); dev->priv = ts;
@@ -370,7 +374,8 @@ static int ucb1x00_ts_add(struct ucb1x00static void ucb1x00_ts_remove (struct ucb1x00_dev *dev) {struct ucb1x00_ts *ts = dev->priv; -input_unregister_device (&ts->idev); + +input_unregister_device (ts->idev);kfree (ts); }
PATCH 1/1 driver model wakeup flags
In reply to Greg KH[PATCH] driver model wakeup flags
This is a refresh of an earlier patch to add "wakeup" support to the PM core model. This provides per-device bus-neutral control of the use of wakeup events.
* "struct device_pm_info" has two bits that are initialized as part of setting up the enclosing struct device:
- "can_wakeup", reflecting hardware capabilities
- "may_wakeup", the policy setting (when CONFIG_PM)
* There's a writeable sysfs "wakeup" file, with one of two values:
- "enabled", when the policy is to allow wakeup
- "disabled", when the policy is not to allow it
- "" if the device can't currently issue wakeups
By default, wakeup is enabled on all devices that support it. If its driver doesn't support it ... treat it as a bug. :)
---
commit 79eef3cfd105168a2115fff06971af8efa27db82
tree 078336166c58694cab5086cc6b69443226985445
parent 409d93787e8cfec603d512c2925f8580c32a9d0a
author David Brownell <[email protected]> Mon, 12 Sep 2005 19:39:34 -0700 committer Greg Kroah-Hartman <[email protected]> Thu, 27 Oct 2005 22:47:59 -0700
drivers/base/core.c | 1 + drivers/base/power/sysfs.c | 73 ++++++++++++++++++++++++++++++++++++++++++++ include/linux/pm.h | 26 +++++++++++++++- 3 files changed, 99 insertions(+), 1 deletions(-)
drivers/base/core.c +1 -0
@@ -225,6 +225,7 @@ void device_initialize(struct device *de klist_children_put);INIT_LIST_HEAD (&dev->dma_pools);init_MUTEX (&dev->sem); +device_init_wakeup (dev,0 ); }/**
drivers/base/power/sysfs.c +73 -0
81 lines not on this page · raw message
include/linux/pm.h +25 -1
@@ -219,7 +219,9 @@ typedef struct pm_message {struct dev_pm_info {pm_message_t power_state; +unsigned can_wakeup:1 ;#ifdef CONFIG_PM +unsigned should_wakeup:1 ;pm_message_t prev_state;void * saved_state;atomic_t pm_users;
@@ -236,13 +238,35 @@ extern void device_resume(void);#ifdef CONFIG_PM extern int device_suspend (pm_message_t state); -#else + +#define device_set_wakeup_enable (dev,val) \ + ((dev)->power.should_wakeup = !!(val)) +#define device_may_wakeup (dev) \ + (device_can_wakeup(dev) && (dev)->power.should_wakeup) + +#else /* !CONFIG_PM */ +static inline int device_suspend (pm_message_t state) {return 0 ; } + +#define device_set_wakeup_enable (dev,val) do{}while(0) +#define device_may_wakeup (dev) (0) +#endif +/* changes to device_may_wakeup take effect on the next pm state change. +* by default, devices should wakeup if they can. +*/ +#define device_can_wakeup (dev) \ + ((dev)->power.can_wakeup) +#define device_init_wakeup (dev,val) \ + do { \ + device_can_wakeup(dev) = !!(val); \ + device_set_wakeup_enable(dev,val); \ + } while(0) +#endif /* __KERNEL__ */ #endif /* _LINUX_PM_H */
PATCH 1/1 drivers/input/touchscreen: convert to dynamic input_dev allocation
In reply to Greg KH[PATCH] drivers/input/touchscreen: convert to dynamic input_dev allocation
Input: convert drivers/input/touchscreen to dynamic input_dev allocation
This is required for input_dev sysfs integration
---
commit a7827f4a9186387c432f3c802ea6330396d83eb9
tree ffe7249d34b35003a0fac1882cfedd5edb0ae02e
parent 61ae45fa4a9d1637a430965ee3743c1c42f07268
author Dmitry Torokhov <[email protected]> Thu, 15 Sep 2005 02:01:46 -0500 committer Greg Kroah-Hartman <[email protected]> Thu, 27 Oct 2005 22:48:04 -0700
drivers/input/touchscreen/corgi_ts.c | 93 +++++++++-------- drivers/input/touchscreen/elo.c | 89 ++++++++--------- drivers/input/touchscreen/gunze.c | 66 ++++++------ drivers/input/touchscreen/h3600_ts_input.c | 149 +++++++++++----------------- drivers/input/touchscreen/hp680_ts_input.c | 58 +++++------ drivers/input/touchscreen/mk712.c | 80 ++++++++------- drivers/input/touchscreen/mtouch.c | 64 ++++++------ 7 files changed, 285 insertions(+), 314 deletions(-)
drivers/input/touchscreen/corgi_ts.c +47 -46
@@ -41,8 +41,7 @@ struct ts_event { };struct corgi_ts { -char phys[32 ]; -struct input_dev input; +struct input_dev *input;struct timer_list timer;struct ts_event tc;int pendown;
@@ -182,14 +181,12 @@ static void new_data(struct corgi_ts *coif (!corgi_ts->tc.pressure && corgi_ts->pendown ==0 )return ; -if (regs) -input_regs (&corgi_ts->input, regs); - -input_report_abs (&corgi_ts->input,ABS_X , corgi_ts->tc.x); -input_report_abs (&corgi_ts->input,ABS_Y , corgi_ts->tc.y); -input_report_abs (&corgi_ts->input,ABS_PRESSURE , corgi_ts->tc.pressure); -input_report_key (&corgi_ts->input,BTN_TOUCH , (corgi_ts->pendown !=0 )); -input_sync (&corgi_ts->input); +input_regs (corgi_ts->input, regs); +input_report_abs (corgi_ts->input,ABS_X , corgi_ts->tc.x); +input_report_abs (corgi_ts->input,ABS_Y , corgi_ts->tc.y); +input_report_abs (corgi_ts->input,ABS_PRESSURE , corgi_ts->tc.pressure); +input_report_key (corgi_ts->input,BTN_TOUCH , (corgi_ts->pendown !=0 )); +input_sync (corgi_ts->input); }static void ts_interrupt_main (struct corgi_ts *corgi_ts,int isTimer,struct pt_regs *regs)
@@ -273,39 +270,44 @@ static int __init corgits_probe(struct d {struct corgi_ts *corgi_ts;struct platform_device *pdev =to_platform_device (dev); +struct input_dev *input_dev; +int err = -ENOMEM ; -if (!(corgi_ts =kmalloc (sizeof (struct corgi_ts ),GFP_KERNEL ))) -return -ENOMEM ; + corgi_ts =kzalloc (sizeof (struct corgi_ts ),GFP_KERNEL ); + input_dev =input_allocate_device (); +if (!corgi_ts || !input_dev) + goto fail;dev_set_drvdata (dev, corgi_ts); -memset (corgi_ts,0 ,sizeof (struct corgi_ts )); - corgi_ts->machinfo = dev->platform_data; corgi_ts->irq_gpio =platform_get_irq (pdev,0 );if (corgi_ts->irq_gpio <0 ) { -kfree (corgi_ts); -return -ENODEV ; + err = -ENODEV ; + goto fail; } -init_input_dev (&corgi_ts->input); - corgi_ts->input.evbit[0 ] =BIT (EV_KEY ) |BIT (EV_ABS ); - corgi_ts->input.keybit[LONG (BTN_TOUCH )] =BIT (BTN_TOUCH ); -input_set_abs_params (&corgi_ts->input,ABS_X ,X_AXIS_MIN ,X_AXIS_MAX ,0 ,0 ); -input_set_abs_params (&corgi_ts->input,ABS_Y ,Y_AXIS_MIN ,Y_AXIS_MAX ,0 ,0 ); -input_set_abs_params (&corgi_ts->input,ABS_PRESSURE ,PRESSURE_MIN ,PRESSURE_MAX ,0 ,0 ); - -strcpy (corgi_ts->phys,"corgits/input0" ); - - corgi_ts->input.private = corgi_ts; - corgi_ts->input.name ="Corgi Touchscreen" ; - corgi_ts->input.dev = dev; - corgi_ts->input.phys = corgi_ts->phys; - corgi_ts->input.id.bustype =BUS_HOST ; - corgi_ts->input.id.vendor =0x0001 ; - corgi_ts->input.id.product =0x0002 ; - corgi_ts->input.id.version =0x0100 ; + corgi_ts->input = input_dev; + +init_timer (&corgi_ts->timer); + corgi_ts->timer.data = (unsigned long ) corgi_ts; + corgi_ts->timer.function = corgi_ts_timer; + + input_dev->name ="Corgi Touchscreen" ; + input_dev->phys ="corgits/input0" ; + input_dev->id.bustype =BUS_HOST ; + input_dev->id.vendor =0x0001 ; + input_dev->id.product =0x0002 ; + input_dev->id.version =0x0100 ; + input_dev->cdev.dev = dev; + input_dev->private = corgi_ts; + + input_dev->evbit[0 ] =BIT (EV_KEY ) |BIT (EV_ABS ); + input_dev->keybit[LONG (BTN_TOUCH )] =BIT (BTN_TOUCH ); +input_set_abs_params (input_dev,ABS_X ,X_AXIS_MIN ,X_AXIS_MAX ,0 ,0 ); +input_set_abs_params (input_dev,ABS_Y ,Y_AXIS_MIN ,Y_AXIS_MAX ,0 ,0 ); +input_set_abs_params (input_dev,ABS_PRESSURE ,PRESSURE_MIN ,PRESSURE_MAX ,0 ,0 );pxa_gpio_mode (IRQ_TO_GPIO (corgi_ts->irq_gpio) |GPIO_IN );
@@ -319,25 +321,24 @@ static int __init corgits_probe(struct dcorgi_ssp_ads7846_putget ((5u <<ADSCTRL_ADR_SH ) |ADSCTRL_STS );mdelay (5 ); -init_timer (&corgi_ts->timer); - corgi_ts->timer.data = (unsigned long ) corgi_ts; - corgi_ts->timer.function = corgi_ts_timer; - -input_register_device (&corgi_ts->input); - corgi_ts->power_mode =PWR_MODE_ACTIVE ; -if (request_irq (corgi_ts->irq_gpio, ts_interrupt,SA_INTERRUPT ,"ts" , corgi_ts)) { -input_unregister_device (&corgi_ts->input); -kfree (corgi_ts); -return -EBUSY ; + err = -EBUSY ; + goto fail; } +input_register_device (corgi_ts->input); + + corgi_ts->power_mode =PWR_MODE_ACTIVE ; +/* Enable Falling Edge */ set_irq_type (corgi_ts->irq_gpio,IRQT_FALLING ); -printk (KERN_INFO "input: Corgi Touchscreen Registered\n" ); -return 0 ; + + fail:input_free_device (input_dev); +kfree (corgi_ts); +return err; + }static int corgits_remove (struct device *dev)
@@ -347,7 +348,7 @@ static int corgits_remove(struct devicefree_irq (corgi_ts->irq_gpio,NULL );del_timer_sync (&corgi_ts->timer); corgi_ts->machinfo->put_hsync (); -input_unregister_device (&corgi_ts->input); +input_unregister_device (corgi_ts->input);kfree (corgi_ts);return 0 ; }
drivers/input/touchscreen/elo.c +44 -45
167 lines not on this page · raw message
drivers/input/touchscreen/gunze.c +33 -33
110 lines not on this page · raw message
drivers/input/touchscreen/h3600_ts_input.c +59 -90
230 lines not on this page · raw message
drivers/input/touchscreen/hp680_ts_input.c +29 -29
87 lines not on this page · raw message
drivers/input/touchscreen/mk712.c +41 -39
135 lines not on this page · raw message
drivers/input/touchscreen/mtouch.c +32 -32
108 lines not on this page · raw message
PATCH 1/1 drivers/input/keyboard: convert to dynamic input_dev allocation
In reply to Greg KH[PATCH] drivers/input/keyboard: convert to dynamic input_dev allocation
Input: convert drivers/input/keyboard to dynamic input_dev allocation
This is required for input_dev sysfs integration
---
commit 6c54454d97a93b1d747e4b16a45237b03e8ac6d1
tree a92ced3a9db4f4fd88a45e8c3bf85883b743ed55
parent f18c31d676d42b4f75f1520733f4b5b2c966524d
author Dmitry Torokhov <[email protected]> Thu, 15 Sep 2005 02:01:45 -0500 committer Greg Kroah-Hartman <[email protected]> Thu, 27 Oct 2005 22:48:04 -0700
drivers/input/keyboard/amikbd.c | 59 +++++------ drivers/input/keyboard/atkbd.c | 188 +++++++++++++++++++---------------- drivers/input/keyboard/corgikbd.c | 74 +++++++------- drivers/input/keyboard/lkkbd.c | 126 ++++++++++++----------- drivers/input/keyboard/maple_keyb.c | 76 ++++++-------- drivers/input/keyboard/newtonkbd.c | 83 +++++++-------- drivers/input/keyboard/spitzkbd.c | 77 ++++++++------ drivers/input/keyboard/sunkbd.c | 117 ++++++++++++---------- drivers/input/keyboard/xtkbd.c | 82 +++++++-------- 9 files changed, 450 insertions(+), 432 deletions(-)
drivers/input/keyboard/amikbd.c +29 -30
@@ -155,10 +155,7 @@ static const char *amikbd_messages[8] = [7] = KERN_WARNING "amikbd: keyboard interrupt\n" }; -static struct input_dev amikbd_dev; - -static char *amikbd_name ="Amiga keyboard" ; -static char *amikbd_phys ="amikbd/input0" ; +static struct input_dev *amikbd_dev;static irqreturn_t amikbd_interrupt (int irq,void *dummy,struct pt_regs *fp) {
@@ -176,16 +173,16 @@ static irqreturn_t amikbd_interrupt(int scancode = amikbd_keycode[scancode]; -input_regs (&amikbd_dev, fp); +input_regs (amikbd_dev, fp);if (scancode ==KEY_CAPSLOCK ) {/* CapsLock is a toggle switch key on Amiga */ -input_report_key (&amikbd_dev, scancode,1 ); -input_report_key (&amikbd_dev, scancode,0 ); -input_sync (&amikbd_dev); +input_report_key (amikbd_dev, scancode,1 ); +input_report_key (amikbd_dev, scancode,0 ); }else { -input_report_key (&amikbd_dev, scancode, down); -input_sync (&amikbd_dev); +input_report_key (amikbd_dev, scancode, down); } + +input_sync (amikbd_dev); }else /* scancodes >= 0x78 are error codes */ printk (amikbd_messages[scancode -0x78 ]);
@@ -202,39 +199,41 @@ static int __init amikbd_init(void)if (!request_mem_region (CIAA_PHYSADDR -1 +0xb00 ,0x100 ,"amikeyb" ))return -EBUSY ; -init_input_dev (&amikbd_dev); - - amikbd_dev.evbit[0 ] =BIT (EV_KEY ) |BIT (EV_REP ); - amikbd_dev.keycode = amikbd_keycode; - amikbd_dev.keycodesize =sizeof (unsigned char ); - amikbd_dev.keycodemax =ARRAY_SIZE (amikbd_keycode); + amikbd_dev =input_dev_allocate (); +if (!amikbd_dev) { +printk (KERN_ERR "amikbd: not enough memory for input device\n" ); +release_mem_region (CIAA_PHYSADDR -1 +0xb00 ,0x100 ); +return -ENOMEM ; + } + + amikbd_dev->name ="Amiga Keyboard" ; + amikbd_dev->phys ="amikbd/input0" ; + amikbd_dev->id.bustype =BUS_AMIGA ; + amikbd_dev->id.vendor =0x0001 ; + amikbd_dev->id.product =0x0001 ; + amikbd_dev->id.version =0x0100 ; + + amikbd_dev->evbit[0 ] =BIT (EV_KEY ) |BIT (EV_REP ); + amikbd_dev->keycode = amikbd_keycode; + amikbd_dev->keycodesize =sizeof (unsigned char ); + amikbd_dev->keycodemax =ARRAY_SIZE (amikbd_keycode);for (i =0 ; i <0x78 ; i++)if (amikbd_keycode[i]) -set_bit (amikbd_keycode[i], amikbd_dev.keybit); +set_bit (amikbd_keycode[i], amikbd_dev->keybit); ciaa.cra &= ~0x41 ;/* serial data in, turn off TA */ request_irq (IRQ_AMIGA_CIAA_SP , amikbd_interrupt,0 ,"amikbd" , amikbd_interrupt); - amikbd_dev.name = amikbd_name; - amikbd_dev.phys = amikbd_phys; - amikbd_dev.id.bustype =BUS_AMIGA ; - amikbd_dev.id.vendor =0x0001 ; - amikbd_dev.id.product =0x0001 ; - amikbd_dev.id.version =0x0100 ; - -input_register_device (&amikbd_dev); - -printk (KERN_INFO "input: %s\n" , amikbd_name); - +input_register_device (amikbd_dev);return 0 ; } static void __exit amikbd_exit(void) { -input_unregister_device (&amikbd_dev);free_irq (IRQ_AMIGA_CIAA_SP , amikbd_interrupt); -release_mem_region (CIAA_PHYSADDR -1 +0xb00 ,0x100 ); +input_unregister_device (amikbd_dev); +release_mem_region (CIAA_PHYSADDR -1 +0xb00 ,0x100 ); }module_init (amikbd_init);
drivers/input/keyboard/atkbd.c +102 -86
411 lines not on this page · raw message
drivers/input/keyboard/corgikbd.c +39 -35
143 lines not on this page · raw message
drivers/input/keyboard/lkkbd.c +63 -63
212 lines not on this page · raw message
drivers/input/keyboard/maple_keyb.c +33 -43
120 lines not on this page · raw message
drivers/input/keyboard/newtonkbd.c +39 -44
125 lines not on this page · raw message
drivers/input/keyboard/spitzkbd.c +44 -33
147 lines not on this page · raw message
drivers/input/keyboard/sunkbd.c +62 -55
179 lines not on this page · raw message
drivers/input/keyboard/xtkbd.c +39 -43
121 lines not on this page · raw message
PATCH 1/1 add sysfs attr to re-emit device hotplug event
In reply to Greg KH[PATCH] add sysfs attr to re-emit device hotplug event
A "coldplug + udevstart" can be simple like this:
for i in /sys/block/*/*/uevent; do echo 1 > $i; done for i in /sys/class/*/*/uevent; do echo 1 > $i; done for i in /sys/bus/*/devices/*/uevent; do echo 1 > $i; done
---
commit d54bc6daa47cc8821fee219877916b32119ab919
tree 10276fc0e96b02d7afb906dcef19737d935d0828
parent 6f5ace97359fa038cffb977dcf057764197f0df5
author Kay Sievers <[email protected]> Sat, 01 Oct 2005 14:49:43 +0200 committer Greg Kroah-Hartman <[email protected]> Thu, 27 Oct 2005 22:48:00 -0700
drivers/base/class.c | 16 ++++++++++++- drivers/base/core.c | 16 +++++++++++++ drivers/block/genhd.c | 25 +++++++++++++++++++++ fs/partitions/check.c | 27 ++++++++++++++++++++++- include/linux/device.h | 57 ++++++++++++++++++++++++------------------------ include/linux/genhd.h | 1 + 6 files changed, 110 insertions(+), 32 deletions(-)
drivers/base/class.c +14 -2
@@ -442,6 +442,13 @@ static ssize_t show_dev(struct class_devreturn print_dev_t (buf, class_dev->devt); } +static ssize_t store_uevent (struct class_device *class_dev, +const char *buf,size_t count) +{ +kobject_hotplug (&class_dev->kobj,KOBJ_ADD ); +return count; +} +void class_device_initialize (struct class_device *class_dev) {kobj_set_kset_s (class_dev, class_obj_subsys);
@@ -497,6 +504,12 @@ int class_device_add(struct class_device goto register_done;/* add the needed attributes to this device */ + class_dev->uevent_attr.attr.name ="uevent" ; + class_dev->uevent_attr.attr.mode =S_IWUSR ; + class_dev->uevent_attr.attr.owner = parent->owner; + class_dev->uevent_attr.store = store_uevent; +class_device_create_file (class_dev, &class_dev->uevent_attr); +if (MAJOR (class_dev->devt)) {struct class_device_attribute *attr; attr =kzalloc (sizeof (*attr),GFP_KERNEL );
@@ -505,12 +518,10 @@ int class_device_add(struct class_devicekobject_del (&class_dev->kobj); goto register_done; } - attr->attr.name ="dev" ; attr->attr.mode =S_IRUGO ; attr->attr.owner = parent->owner; attr->show = show_dev; - attr->store =NULL ;class_device_create_file (class_dev, attr); class_dev->devt_attr = attr; }
@@ -621,6 +632,7 @@ void class_device_del(struct class_devicsysfs_remove_link (&class_dev->kobj,"device" );sysfs_remove_link (&class_dev->dev->kobj, class_name); } +class_device_remove_file (class_dev, &class_dev->uevent_attr);if (class_dev->devt_attr)class_device_remove_file (class_dev, class_dev->devt_attr);class_device_remove_attrs (class_dev);
drivers/base/core.c +16 -0
@@ -154,6 +154,13 @@ static struct kset_hotplug_ops device_ho .hotplug = dev_hotplug, }; +static ssize_t store_uevent (struct device *dev,struct device_attribute *attr, +const char *buf,size_t count) +{ +kobject_hotplug (&dev->kobj,KOBJ_ADD ); +return count; +} +/** * device_subsys - structure to be registered with kobject core. */
@@ -259,6 +266,14 @@ int device_add(struct device *dev)if ((error =kobject_add (&dev->kobj))) goto Error; + + dev->uevent_attr.attr.name ="uevent" ; + dev->uevent_attr.attr.mode =S_IWUSR ; +if (dev->driver) + dev->uevent_attr.attr.owner = dev->driver->owner; + dev->uevent_attr.store = store_uevent; +device_create_file (dev, &dev->uevent_attr); +kobject_hotplug (&dev->kobj,KOBJ_ADD );if ((error =device_pm_add (dev))) goto PMError;
@@ -350,6 +365,7 @@ void device_del(struct device * dev)if (parent)klist_del (&dev->knode_parent); +device_remove_file (dev, &dev->uevent_attr);/* Notify the platform of the removal, in case they * need to do anything...
drivers/block/genhd.c +25 -0
@@ -337,10 +337,30 @@ static ssize_t disk_attr_show(struct kobreturn ret; } +static ssize_t disk_attr_store (struct kobject * kobj,struct attribute * attr, +const char *page,size_t count) +{ +struct gendisk *disk =to_disk (kobj); +struct disk_attribute *disk_attr = + container_of(attr,struct disk_attribute,attr); +ssize_t ret =0 ; + +if (disk_attr->store) + ret = disk_attr->store (disk, page, count); +return ret; +} +static struct sysfs_ops disk_sysfs_ops = { .show = &disk_attr_show, + .store = &disk_attr_store, }; +static ssize_t disk_uevent_store (struct gendisk * disk, +const char *buf,size_t count) +{ +kobject_hotplug (&disk->kobj,KOBJ_ADD ); +return count; +}static ssize_t disk_dev_read (struct gendisk * disk,char *page) {dev_t base =MKDEV (disk->major, disk->first_minor);
@@ -382,6 +402,10 @@ static ssize_t disk_stats_read(struct gejiffies_to_msecs (disk_stat_read (disk, io_ticks)), jiffies_to_msecs(disk_stat_read(disk, time_in_queue))); } +static struct disk_attribute disk_attr_uevent = { + .attr = {.name ="uevent" , .mode =S_IWUSR }, + .store = disk_uevent_store +};static struct disk_attribute disk_attr_dev = { .attr = {.name ="dev" , .mode =S_IRUGO }, .show = disk_dev_read
@@ -404,6 +428,7 @@ static struct disk_attribute disk_attr_s };static struct attribute * default_attrs[] = { + &disk_attr_uevent.attr, &disk_attr_dev.attr, &disk_attr_range.attr, &disk_attr_removable.attr,
fs/partitions/check.c +26 -1
@@ -192,6 +192,7 @@ check_partition(struct gendisk *hd, strustruct part_attribute {struct attribute attr;ssize_t (*show)(struct hd_struct *,char *); +ssize_t (*store)(struct hd_struct *,const char *,size_t ); }; static ssize_t
@@ -201,14 +202,33 @@ part_attr_show(struct kobject * kobj, st struct part_attribute * part_attr = container_of(attr,struct part_attribute,attr);ssize_t ret =0 ;if (part_attr->show) - ret = part_attr->show (p,page); + ret = part_attr->show (p, page); +return ret; +} +static ssize_t +part_attr_store (struct kobject * kobj,struct attribute * attr, +const char *page,size_t count) +{ + struct hd_struct * p = container_of(kobj,struct hd_struct,kobj); + struct part_attribute * part_attr = container_of(attr,struct part_attribute,attr); +ssize_t ret =0 ; + +if (part_attr->store) + ret = part_attr->store (p, page, count);return ret; }static struct sysfs_ops part_sysfs_ops = { .show = part_attr_show, + .store = part_attr_store, }; +static ssize_t part_uevent_store (struct hd_struct * p, +const char *page,size_t count) +{ +kobject_hotplug (&p->kobj,KOBJ_ADD ); +return count; +}static ssize_t part_dev_read (struct hd_struct * p,char *page) { struct gendisk *disk = container_of(p->kobj.parent,struct gendisk,kobj);
@@ -229,6 +249,10 @@ static ssize_t part_stat_read(struct hd_ p->reads, (unsigned long long )p->read_sectors, p->writes, (unsigned long long)p->write_sectors); } +static struct part_attribute part_attr_uevent = { + .attr = {.name ="uevent" , .mode =S_IWUSR }, + .store = part_uevent_store +};static struct part_attribute part_attr_dev = { .attr = {.name ="dev" , .mode =S_IRUGO }, .show = part_dev_read
@@ -247,6 +271,7 @@ static struct part_attribute part_attr_s };static struct attribute * default_attrs[] = { + &part_attr_uevent.attr, &part_attr_dev.attr, &part_attr_start.attr, &part_attr_size.attr,
include/linux/device.h +28 -29
93 lines not on this page · raw message
include/linux/genhd.h +1 -0
@@ -132,6 +132,7 @@ struct gendisk {struct disk_attribute {struct attribute attr;ssize_t (*show)(struct gendisk *,char *); +ssize_t (*store)(struct gendisk *,const char *,size_t ); };/*
PATCH 1/1 Driver Core: document struct class_device properly
In reply to Greg KH[PATCH] Driver Core: document struct class_device properly
---
commit e9a873633c67dd048c9d53f3e934e83df10312d1
tree 9152a484f16797773dce293c205e5e71b1260322
parent c5d4abda2b87357d5ba32b0c8babb532eb75d9c7
author Greg Kroah-Hartman <[email protected]> Thu, 27 Oct 2005 22:25:43 -0700 committer Greg Kroah-Hartman <[email protected]> Thu, 27 Oct 2005 22:48:03 -0700
include/linux/device.h | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-)
include/linux/device.h +24 -0
@@ -203,6 +203,30 @@ struct class_device_attribute class_deviextern int class_device_create_file (struct class_device *,const struct class_device_attribute *); +/** +* struct class_device - class devices +* @class: pointer to the parent class for this class device. This is required. +* @devt: for internal use by the driver core only. +* @node: for internal use by the driver core only. +* @kobj: for internal use by the driver core only. +* @devt_attr: for internal use by the driver core only. +* @dev: if set, a symlink to the struct device is created in the sysfs +* directory for this struct class device. +* @class_data: pointer to whatever you want to store here for this struct +* class_device. Use class_get_devdata() and class_set_devdata() to get and +* set this pointer. +* @parent: pointer to a struct class_device that is the parent of this struct +* class_device. If NULL, this class_device will show up at the root of the +* struct class in sysfs (which is probably what you want to have happen.) +* @release: pointer to a release function for this struct class_device. If +* set, this will be called instead of the class specific release function. +* Only use this if you want to override the default release function, like +* when you are nesting class_device structures. +* @hotplug: pointer to a hotplug function for this struct class_device. If +* set, this will be called instead of the class specific hotplug function. +* Only use this if you want to override the default hotplug function, like +* when you are nesting class_device structures. +*/ struct class_device {struct list_head node;
PATCH 1/1 drivers/input/mouse: convert to dynamic input_dev allocation
[PATCH] drivers/input/mouse: convert to dynamic input_dev allocation
Input: convert drivers/input/mouse to dynamic input_dev allocation
This is required for input_dev sysfs integration
---
commit f18c31d676d42b4f75f1520733f4b5b2c966524d
tree 9e16a56703102547b10c664ef155099c0dad9e2d
parent 4086434e3a16b83e0cc651b5519f911dfa010cc7
author Dmitry Torokhov <[email protected]> Thu, 15 Sep 2005 02:01:44 -0500 committer Greg Kroah-Hartman <[email protected]> Thu, 27 Oct 2005 22:48:03 -0700
drivers/input/mouse/alps.c | 67 +++++++++++++----------- drivers/input/mouse/alps.h | 2 - drivers/input/mouse/amimouse.c | 51 +++++++++---------- drivers/input/mouse/inport.c | 96 ++++++++++++++++++----------------- drivers/input/mouse/lifebook.c | 16 +++--- drivers/input/mouse/logibm.c | 88 ++++++++++++++++---------------- drivers/input/mouse/logips2pp.c | 20 ++++--- drivers/input/mouse/maplemouse.c | 10 +--- drivers/input/mouse/pc110pad.c | 70 ++++++++++++------------- drivers/input/mouse/psmouse-base.c | 99 +++++++++++++++++++----------------- drivers/input/mouse/psmouse.h | 2 - drivers/input/mouse/rpcmouse.c | 43 ++++++++-------- drivers/input/mouse/sermouse.c | 84 +++++++++++++++---------------- drivers/input/mouse/synaptics.c | 6 +- drivers/input/mouse/vsxxxaa.c | 84 +++++++++++++++---------------- 15 files changed, 370 insertions(+), 368 deletions(-)
drivers/input/mouse/alps.c +35 -32
@@ -79,8 +79,8 @@ static void alps_process_packet(struct p {struct alps_data *priv = psmouse->private;unsigned char *packet = psmouse->packet; -struct input_dev *dev = &psmouse->dev; -struct input_dev *dev2 = &priv->dev2; +struct input_dev *dev = psmouse->dev; +struct input_dev *dev2 = priv->dev2;int x, y, z, ges, fin, left, right, middle;int back =0 , forward =0 ;
@@ -379,20 +379,24 @@ static int alps_reconnect(struct psmousestatic void alps_disconnect (struct psmouse *psmouse) {struct alps_data *priv = psmouse->private; +psmouse_reset (psmouse); -input_unregister_device (&priv->dev2); +input_unregister_device (priv->dev2);kfree (priv); }int alps_init (struct psmouse *psmouse) {struct alps_data *priv; +struct input_dev *dev1 = psmouse->dev, *dev2;int version; - psmouse->private = priv =kmalloc (sizeof (struct alps_data ),GFP_KERNEL ); -if (!priv) + psmouse->private = priv =kzalloc (sizeof (struct alps_data ),GFP_KERNEL ); + dev2 =input_allocate_device (); +if (!priv || !dev2) goto init_fail; -memset (priv,0 ,sizeof (struct alps_data )); + + priv->dev2 = dev2;if (!(priv->i =alps_get_model (psmouse, &version))) goto init_fail;
@@ -411,41 +415,39 @@ int alps_init(struct psmouse *psmouse)if ((priv->i->flags &ALPS_PASS ) &&alps_passthrough_mode (psmouse,0 )) goto init_fail; - psmouse->dev.evbit[LONG (EV_KEY )] |=BIT (EV_KEY ); - psmouse->dev.keybit[LONG (BTN_TOUCH )] |=BIT (BTN_TOUCH ); - psmouse->dev.keybit[LONG (BTN_TOOL_FINGER )] |=BIT (BTN_TOOL_FINGER ); - psmouse->dev.keybit[LONG (BTN_LEFT )] |=BIT (BTN_LEFT ) |BIT (BTN_MIDDLE ) |BIT (BTN_RIGHT ); - - psmouse->dev.evbit[LONG (EV_ABS )] |=BIT (EV_ABS ); -input_set_abs_params (&psmouse->dev,ABS_X ,0 ,1023 ,0 ,0 ); -input_set_abs_params (&psmouse->dev,ABS_Y ,0 ,767 ,0 ,0 ); -input_set_abs_params (&psmouse->dev,ABS_PRESSURE ,0 ,127 ,0 ,0 ); + dev1->evbit[LONG (EV_KEY )] |=BIT (EV_KEY ); + dev1->keybit[LONG (BTN_TOUCH )] |=BIT (BTN_TOUCH ); + dev1->keybit[LONG (BTN_TOOL_FINGER )] |=BIT (BTN_TOOL_FINGER ); + dev1->keybit[LONG (BTN_LEFT )] |=BIT (BTN_LEFT ) |BIT (BTN_MIDDLE ) |BIT (BTN_RIGHT ); + + dev1->evbit[LONG (EV_ABS )] |=BIT (EV_ABS ); +input_set_abs_params (dev1,ABS_X ,0 ,1023 ,0 ,0 ); +input_set_abs_params (dev1,ABS_Y ,0 ,767 ,0 ,0 ); +input_set_abs_params (dev1,ABS_PRESSURE ,0 ,127 ,0 ,0 );if (priv->i->flags &ALPS_WHEEL ) { - psmouse->dev.evbit[LONG (EV_REL )] |=BIT (EV_REL ); - psmouse->dev.relbit[LONG (REL_WHEEL )] |=BIT (REL_WHEEL ); + dev1->evbit[LONG (EV_REL )] |=BIT (EV_REL ); + dev1->relbit[LONG (REL_WHEEL )] |=BIT (REL_WHEEL ); }if (priv->i->flags & (ALPS_FW_BK_1 |ALPS_FW_BK_2 )) { - psmouse->dev.keybit[LONG (BTN_FORWARD )] |=BIT (BTN_FORWARD ); - psmouse->dev.keybit[LONG (BTN_BACK )] |=BIT (BTN_BACK ); + dev1->keybit[LONG (BTN_FORWARD )] |=BIT (BTN_FORWARD ); + dev1->keybit[LONG (BTN_BACK )] |=BIT (BTN_BACK ); }sprintf (priv->phys,"%s/input1" , psmouse->ps2dev.serio->phys); - priv->dev2.phys = priv->phys; - priv->dev2.name = (priv->i->flags &ALPS_DUALPOINT ) ?"DualPoint Stick" :"PS/2 Mouse" ; - priv->dev2.id.bustype =BUS_I8042 ; - priv->dev2.id.vendor =0x0002 ; - priv->dev2.id.product =PSMOUSE_ALPS ; - priv->dev2.id.version =0x0000 ; - - priv->dev2.evbit[0 ] =BIT (EV_KEY ) |BIT (EV_REL ); - priv->dev2.relbit[LONG (REL_X )] |=BIT (REL_X ) |BIT (REL_Y ); - priv->dev2.keybit[LONG (BTN_LEFT )] |=BIT (BTN_LEFT ) |BIT (BTN_MIDDLE ) |BIT (BTN_RIGHT ); - -input_register_device (&priv->dev2); + dev2->phys = priv->phys; + dev2->name = (priv->i->flags &ALPS_DUALPOINT ) ?"DualPoint Stick" :"PS/2 Mouse" ; + dev2->id.bustype =BUS_I8042 ; + dev2->id.vendor =0x0002 ; + dev2->id.product =PSMOUSE_ALPS ; + dev2->id.version =0x0000 ; + + dev2->evbit[0 ] =BIT (EV_KEY ) |BIT (EV_REL ); + dev2->relbit[LONG (REL_X )] |=BIT (REL_X ) |BIT (REL_Y ); + dev2->keybit[LONG (BTN_LEFT )] |=BIT (BTN_LEFT ) |BIT (BTN_MIDDLE ) |BIT (BTN_RIGHT ); -printk (KERN_INFO "input: %s on %s\n" , priv->dev2.name, psmouse->ps2dev.serio->phys); +input_register_device (priv->dev2); psmouse->protocol_handler = alps_process_byte; psmouse->disconnect = alps_disconnect;
@@ -455,6 +457,7 @@ int alps_init(struct psmouse *psmouse)return 0 ; init_fail: +input_free_device (dev2);kfree (priv);return -1 ; }
drivers/input/mouse/alps.h +1 -1
@@ -22,7 +22,7 @@ struct alps_model_info { };struct alps_data { -struct input_dev dev2;/* Relative device */ +struct input_dev *dev2;/* Relative device */ char name[32 ];/* Name */ char phys[32 ];/* Phys */ struct alps_model_info *i;/* Info */
drivers/input/mouse/amimouse.c +25 -26
79 lines not on this page · raw message
drivers/input/mouse/inport.c +49 -47
146 lines not on this page · raw message
drivers/input/mouse/lifebook.c +9 -7
@@ -34,7 +34,7 @@ static struct dmi_system_id lifebook_dmistatic psmouse_ret_t lifebook_process_byte (struct psmouse *psmouse,struct pt_regs *regs) {unsigned char *packet = psmouse->packet; -struct input_dev *dev = &psmouse->dev; +struct input_dev *dev = psmouse->dev;if (psmouse->pktcnt !=3 )return PSMOUSE_GOOD_DATA ;
@@ -113,15 +113,17 @@ int lifebook_detect(struct psmouse *psmoint lifebook_init (struct psmouse *psmouse) { +struct input_dev *input_dev = psmouse->dev; +if (lifebook_absolute_mode (psmouse))return -1 ; - psmouse->dev.evbit[0 ] =BIT (EV_ABS ) |BIT (EV_KEY ) |BIT (EV_REL ); - psmouse->dev.keybit[LONG (BTN_LEFT )] =BIT (BTN_LEFT ) |BIT (BTN_MIDDLE ) |BIT (BTN_RIGHT ); - psmouse->dev.keybit[LONG (BTN_TOUCH )] =BIT (BTN_TOUCH ); - psmouse->dev.relbit[0 ] =BIT (REL_X ) |BIT (REL_Y ); -input_set_abs_params (&psmouse->dev,ABS_X ,0 ,1024 ,0 ,0 ); -input_set_abs_params (&psmouse->dev,ABS_Y ,0 ,1024 ,0 ,0 ); + input_dev->evbit[0 ] =BIT (EV_ABS ) |BIT (EV_KEY ) |BIT (EV_REL ); + input_dev->keybit[LONG (BTN_LEFT )] =BIT (BTN_LEFT ) |BIT (BTN_MIDDLE ) |BIT (BTN_RIGHT ); + input_dev->keybit[LONG (BTN_TOUCH )] =BIT (BTN_TOUCH ); + input_dev->relbit[0 ] =BIT (REL_X ) |BIT (REL_Y ); +input_set_abs_params (input_dev,ABS_X ,0 ,1024 ,0 ,0 ); +input_set_abs_params (input_dev,ABS_Y ,0 ,1024 ,0 ,0 ); psmouse->protocol_handler = lifebook_process_byte; psmouse->set_resolution = lifebook_set_resolution;
drivers/input/mouse/logibm.c +45 -43
118 lines not on this page · raw message
drivers/input/mouse/logips2pp.c +11 -9
@@ -40,7 +40,7 @@ struct ps2pp_info {static psmouse_ret_t ps2pp_process_byte (struct psmouse *psmouse,struct pt_regs *regs) { -struct input_dev *dev = &psmouse->dev; +struct input_dev *dev = psmouse->dev;unsigned char *packet = psmouse->packet;if (psmouse->pktcnt <3 )
@@ -257,25 +257,27 @@ static struct ps2pp_info *get_model_infostatic void ps2pp_set_model_properties (struct psmouse *psmouse,struct ps2pp_info *model_info,int using_ps2pp) { +struct input_dev *input_dev = psmouse->dev; +if (model_info->features &PS2PP_SIDE_BTN ) -set_bit (BTN_SIDE , psmouse->dev.keybit); +set_bit (BTN_SIDE , input_dev->keybit);if (model_info->features &PS2PP_EXTRA_BTN ) -set_bit (BTN_EXTRA , psmouse->dev.keybit); +set_bit (BTN_EXTRA , input_dev->keybit);if (model_info->features &PS2PP_TASK_BTN ) -set_bit (BTN_TASK , psmouse->dev.keybit); +set_bit (BTN_TASK , input_dev->keybit);if (model_info->features &PS2PP_NAV_BTN ) { -set_bit (BTN_FORWARD , psmouse->dev.keybit); -set_bit (BTN_BACK , psmouse->dev.keybit); +set_bit (BTN_FORWARD , input_dev->keybit); +set_bit (BTN_BACK , input_dev->keybit); }if (model_info->features &PS2PP_WHEEL ) -set_bit (REL_WHEEL , psmouse->dev.relbit); +set_bit (REL_WHEEL , input_dev->relbit);if (model_info->features &PS2PP_HWHEEL ) -set_bit (REL_HWHEEL , psmouse->dev.relbit); +set_bit (REL_HWHEEL , input_dev->relbit);switch (model_info->kind) {case PS2PP_KIND_WHEEL :
@@ -387,7 +389,7 @@ int ps2pp_init(struct psmouse *psmouse, }if (buttons <3 ) -clear_bit (BTN_MIDDLE , psmouse->dev.keybit); +clear_bit (BTN_MIDDLE , psmouse->dev->keybit);if (model_info)ps2pp_set_model_properties (psmouse, model_info, use_ps2pp);
drivers/input/mouse/maplemouse.c +3 -7
@@ -41,13 +41,12 @@ static int dc_mouse_connect(struct mapleunsigned long data =be32_to_cpu (dev->devinfo.function_data[0 ]);struct input_dev *input_dev; -if (!(input_dev =kmalloc (sizeof (struct input_dev ),GFP_KERNEL ))) -return -1 ; + dev->private_data = input_dev =input_allocate_device (); +if (!input_dev) +return -ENOMEM ; dev->private_data = input_dev; -memset (input_dev,0 ,sizeof (struct dc_mouse )); -init_input_dev (input_dev); input_dev->evbit[0 ] =BIT (EV_KEY ) |BIT (EV_REL ); input_dev->keybit[LONG (BTN_MOUSE )] =BIT (BTN_LEFT ) |BIT (BTN_RIGHT ) |BIT (BTN_MIDDLE ); input_dev->relbit[0 ] =BIT (REL_X ) |BIT (REL_Y ) |BIT (REL_WHEEL );
@@ -59,8 +58,6 @@ static int dc_mouse_connect(struct maplemaple_getcond_callback (dev, dc_mouse_callback,1 ,MAPLE_FUNC_MOUSE ); -printk (KERN_INFO "input: mouse(0x%lx): %s\n" , data, input_dev->name); -return 0 ; }
@@ -70,7 +67,6 @@ static void dc_mouse_disconnect(struct mstruct input_dev *input_dev = dev->private_data;input_unregister_device (input_dev); -kfree (input_dev); }
drivers/input/mouse/pc110pad.c +34 -36
115 lines not on this page · raw message
drivers/input/mouse/psmouse-base.c +53 -46
230 lines not on this page · raw message
drivers/input/mouse/psmouse.h +1 -1
@@ -36,7 +36,7 @@ typedef enum {struct psmouse {void *private; -struct input_dev dev; +struct input_dev *dev;struct ps2dev ps2dev;char *vendor;char *name;
drivers/input/mouse/rpcmouse.c +21 -22
70 lines not on this page · raw message
drivers/input/mouse/sermouse.c +40 -44
126 lines not on this page · raw message
drivers/input/mouse/synaptics.c +3 -3
@@ -342,7 +342,7 @@ static void synaptics_parse_hw_state(uns*/ static void synaptics_process_packet (struct psmouse *psmouse) { -struct input_dev *dev = &psmouse->dev; +struct input_dev *dev = psmouse->dev;struct synaptics_data *priv = psmouse->private;struct synaptics_hw_state hw;int num_fingers;
@@ -473,7 +473,7 @@ static unsigned char synaptics_detect_pkstatic psmouse_ret_t synaptics_process_byte (struct psmouse *psmouse,struct pt_regs *regs) { -struct input_dev *dev = &psmouse->dev; +struct input_dev *dev = psmouse->dev;struct synaptics_data *priv = psmouse->private;input_regs (dev, regs);
@@ -645,7 +645,7 @@ int synaptics_init(struct psmouse *psmouSYN_ID_MAJOR (priv->identity),SYN_ID_MINOR (priv->identity), priv->model_id, priv->capabilities, priv->ext_cap); -set_input_params (&psmouse->dev, priv); +set_input_params (psmouse->dev, priv); psmouse->protocol_handler = synaptics_process_byte; psmouse->set_rate = synaptics_set_rate;
drivers/input/mouse/vsxxxaa.c +40 -44
138 lines not on this page · raw message
PATCH 1/1 Input: convert onetouch to dynamic input_dev allocation
In reply to Greg KH[PATCH] Input: convert onetouch to dynamic input_dev allocation
Input: convert onetouch to dynamic input_dev allocation
This is required for input_dev sysfs integration
---
commit 9b372d662ed489f3aac7e88e9452ce4c923b11d7
tree aa2c555213301822a76e00f07511538849a9c5bf
parent 218e51d8b7c75a09e156696c037e6e3383a7808b
author Dmitry Torokhov <[email protected]> Thu, 15 Sep 2005 02:01:43 -0500 committer Greg Kroah-Hartman <[email protected]> Thu, 27 Oct 2005 22:48:04 -0700
drivers/usb/storage/onetouch.c | 105 ++++++++++++++++++++-------------------- 1 files changed, 53 insertions(+), 52 deletions(-)
drivers/usb/storage/onetouch.c +53 -52
@@ -5,7 +5,7 @@* Copyright (c) 2005 Nick Sillik <[email protected]> * * Initial work by: -* Copyright (c) 2003 Erik Thyren <[email protected]> +* Copyright (c) 2003 Erik Thyren <[email protected]> * * Based on usbmouse.c (Vojtech Pavlik) and xpad.c (Marko Friedemann) *
@@ -46,7 +46,7 @@ void onetouch_release_input(void *onetoustruct usb_onetouch {char name[128 ];char phys[64 ]; -struct input_dev dev;/* input device interface */ +struct input_dev *dev;/* input device interface */ struct usb_device *udev;/* usb device */ struct urb *irq;/* urb for interrupt in report */
@@ -58,7 +58,7 @@ static void usb_onetouch_irq(struct urb {struct usb_onetouch *onetouch = urb->context;signed char *data = onetouch->data; -struct input_dev *dev = &onetouch->dev; +struct input_dev *dev = onetouch->dev;int status;switch (urb->status) {
@@ -74,11 +74,9 @@ static void usb_onetouch_irq(struct urb }input_regs (dev, regs); - -input_report_key (&onetouch->dev,ONETOUCH_BUTTON , - data[0 ] &0x02 ); - +input_report_key (dev,ONETOUCH_BUTTON , data[0 ] &0x02 );input_sync (dev); + resubmit: status =usb_submit_urb (urb,SLAB_ATOMIC );if (status)
@@ -113,8 +111,8 @@ int onetouch_connect_input(struct us_datstruct usb_host_interface *interface;struct usb_endpoint_descriptor *endpoint;struct usb_onetouch *onetouch; +struct input_dev *input_dev;int pipe, maxp; -char path[64 ]; interface = ss->pusb_intf->cur_altsetting;
@@ -122,62 +120,62 @@ int onetouch_connect_input(struct us_datreturn -ENODEV ; endpoint = &interface->endpoint[2 ].desc; -if (!(endpoint->bEndpointAddress &USB_DIR_IN )) +if (!(endpoint->bEndpointAddress &USB_DIR_IN ))return -ENODEV ; -if ((endpoint->bmAttributes &USB_ENDPOINT_XFERTYPE_MASK ) +if ((endpoint->bmAttributes &USB_ENDPOINT_XFERTYPE_MASK ) !=USB_ENDPOINT_XFER_INT )return -ENODEV ; pipe =usb_rcvintpipe (udev, endpoint->bEndpointAddress); maxp =usb_maxpacket (udev, pipe,usb_pipeout (pipe)); -if (!(onetouch =kcalloc (1 ,sizeof (struct usb_onetouch ),GFP_KERNEL ))) -return -ENOMEM ; + onetouch =kzalloc (sizeof (struct usb_onetouch ),GFP_KERNEL ); + input_dev =input_allocate_device (); +if (!onetouch || !input_dev) + goto fail1; onetouch->data =usb_buffer_alloc (udev,ONETOUCH_PKT_LEN ,SLAB_ATOMIC , &onetouch->data_dma); -if (!onetouch->data){ -kfree (onetouch); -return -ENOMEM ; - } +if (!onetouch->data) + goto fail1; onetouch->irq =usb_alloc_urb (0 ,GFP_KERNEL ); -if (!onetouch->irq){ -kfree (onetouch); -usb_buffer_free (udev,ONETOUCH_PKT_LEN , - onetouch->data, onetouch->data_dma); -return -ENODEV ; - } - +if (!onetouch->irq) + goto fail2; onetouch->udev = udev; - -set_bit (EV_KEY , onetouch->dev.evbit); -set_bit (ONETOUCH_BUTTON , onetouch->dev.keybit); -clear_bit (0 , onetouch->dev.keybit); - - onetouch->dev.private = onetouch; - onetouch->dev.open = usb_onetouch_open; - onetouch->dev.close = usb_onetouch_close; - -usb_make_path (udev, path,sizeof (path)); -sprintf (onetouch->phys,"%s/input0" , path); - - onetouch->dev.name = onetouch->name; - onetouch->dev.phys = onetouch->phys; - -usb_to_input_id (udev, &onetouch->dev.id); - - onetouch->dev.dev = &udev->dev; + onetouch->dev = input_dev;if (udev->manufacturer) -strcat (onetouch->name, udev->manufacturer); -if (udev->product) -sprintf (onetouch->name,"%s %s" , onetouch->name, - udev->product); +strlcpy (onetouch->name, udev->manufacturer, +sizeof (onetouch->name)); +if (udev->product) { +if (udev->manufacturer) +strlcat (onetouch->name," " ,sizeof (onetouch->name)); +strlcat (onetouch->name, udev->product,sizeof (onetouch->name)); + } +if (!strlen (onetouch->name)) -sprintf (onetouch->name,"Maxtor Onetouch %04x:%04x" , - onetouch->dev.id.vendor, onetouch->dev.id.product); +snprintf (onetouch->name,sizeof (onetouch->name), +"Maxtor Onetouch %04x:%04x" , +le16_to_cpu (udev->descriptor.idVendor), +le16_to_cpu (udev->descriptor.idProduct)); + +usb_make_path (udev, onetouch->phys,sizeof (onetouch->phys)); +strlcat (onetouch->phys,"/input0" ,sizeof (onetouch->phys)); + + input_dev->name = onetouch->name; + input_dev->phys = onetouch->phys; +usb_to_input_id (udev, &input_dev->id); + input_dev->cdev.dev = &udev->dev; + +set_bit (EV_KEY , input_dev->evbit); +set_bit (ONETOUCH_BUTTON , input_dev->keybit); +clear_bit (0 , input_dev->keybit); + + input_dev->private = onetouch; + input_dev->open = usb_onetouch_open; + input_dev->close = usb_onetouch_close; usb_fill_int_urb(onetouch->irq, udev, pipe, onetouch->data, (maxp > 8 ? 8 : maxp),
@@ -188,10 +186,15 @@ int onetouch_connect_input(struct us_dat ss->extra_destructor = onetouch_release_input; ss->extra = onetouch; -input_register_device (&onetouch->dev); -printk (KERN_INFO "usb-input: %s on %s\n" , onetouch->dev.name, path); +input_register_device (onetouch->dev);return 0 ; + + fail2:usb_buffer_free (udev,ONETOUCH_PKT_LEN , + onetouch->data, onetouch->data_dma); + fail1:kfree (onetouch); +input_free_device (input_dev); +return -ENOMEM ; }void onetouch_release_input (void *onetouch_)
@@ -200,11 +203,9 @@ void onetouch_release_input(void *onetouif (onetouch) {usb_kill_urb (onetouch->irq); -input_unregister_device (&onetouch->dev); +input_unregister_device (onetouch->dev);usb_free_urb (onetouch->irq);usb_buffer_free (onetouch->udev,ONETOUCH_PKT_LEN , onetouch->data, onetouch->data_dma); -printk (KERN_INFO "usb-input: deregistering %s\n" , - onetouch->dev.name); } }
PATCH 1/1 Driver core: pass interface to class interface methods
In reply to Greg KH[PATCH] Driver core: pass interface to class interface methods
Driver core: pass interface to class intreface methods
Pass interface as argument to add() and remove() class interface methods. This way a subsystem can implement generic add/remove handlers and then call interface-specific ones.
---
commit 6f5ace97359fa038cffb977dcf057764197f0df5
tree 704698b1aea6b88af22a5c3cf7f81e2dc9d4b313
parent b02f028de21efe6ba60d1896462a219f1356ea34
author Dmitry Torokhov <[email protected]> Thu, 15 Sep 2005 02:01:36 -0500 committer Greg Kroah-Hartman <[email protected]> Thu, 27 Oct 2005 22:48:00 -0700
drivers/base/class.c | 8 ++++---- drivers/pcmcia/ds.c | 6 ++++-- drivers/pcmcia/rsrc_nonstatic.c | 6 ++++-- drivers/pcmcia/socket_sysfs.c | 6 ++++-- drivers/scsi/sg.c | 8 ++++---- include/linux/device.h | 4 ++-- 6 files changed, 22 insertions(+), 16 deletions(-)
drivers/base/class.c +4 -4
@@ -532,7 +532,7 @@ int class_device_add(struct class_devicelist_add_tail (&class_dev->node, &parent->children);list_for_each_entry (class_intf, &parent->interfaces, node)if (class_intf->add) - class_intf->add (class_dev); + class_intf->add (class_dev, class_intf);up (&parent->sem); }
@@ -612,7 +612,7 @@ void class_device_del(struct class_deviclist_del_init (&class_dev->node);list_for_each_entry (class_intf, &parent->interfaces, node)if (class_intf->remove) - class_intf->remove (class_dev); + class_intf->remove (class_dev, class_intf);up (&parent->sem); }
@@ -729,7 +729,7 @@ int class_interface_register(struct claslist_add_tail (&class_intf->node, &parent->interfaces);if (class_intf->add) {list_for_each_entry (class_dev, &parent->children, node) - class_intf->add (class_dev); + class_intf->add (class_dev, class_intf); }up (&parent->sem);
@@ -748,7 +748,7 @@ void class_interface_unregister(struct clist_del_init (&class_intf->node);if (class_intf->remove) {list_for_each_entry (class_dev, &parent->children, node) - class_intf->remove (class_dev); + class_intf->remove (class_dev, class_intf); }up (&parent->sem);
drivers/pcmcia/ds.c +4 -2
@@ -1157,7 +1157,8 @@ static struct pcmcia_callback pcmcia_bus .requery = pcmcia_bus_rescan, }; -static int __devinit pcmcia_bus_add_socket (struct class_device *class_dev) +static int __devinit pcmcia_bus_add_socket (struct class_device *class_dev, +struct class_interface *class_intf) {struct pcmcia_socket *socket =class_get_devdata (class_dev);int ret;
@@ -1192,7 +1193,8 @@ static int __devinit pcmcia_bus_add_sockreturn 0 ; } -static void pcmcia_bus_remove_socket (struct class_device *class_dev) +static void pcmcia_bus_remove_socket (struct class_device *class_dev, +struct class_interface *class_intf) {struct pcmcia_socket *socket =class_get_devdata (class_dev);
drivers/pcmcia/rsrc_nonstatic.c +4 -2
@@ -994,7 +994,8 @@ static struct class_device_attribute *pc NULL, }; -static int __devinit pccard_sysfs_add_rsrc (struct class_device *class_dev) +static int __devinit pccard_sysfs_add_rsrc (struct class_device *class_dev, +struct class_interface *class_intf) {struct pcmcia_socket *s =class_get_devdata (class_dev);struct class_device_attribute **attr;
@@ -1011,7 +1012,8 @@ static int __devinit pccard_sysfs_add_rsreturn ret; } -static void __devexit pccard_sysfs_remove_rsrc(struct class_device *class_dev) +static void __devexit pccard_sysfs_remove_rsrc(struct class_device *class_dev, +struct class_interface *class_intf) {struct pcmcia_socket *s =class_get_devdata (class_dev);struct class_device_attribute **attr;
drivers/pcmcia/socket_sysfs.c +4 -2
@@ -341,7 +341,8 @@ static struct bin_attribute pccard_cis_a .write = pccard_store_cis, }; -static int __devinit pccard_sysfs_add_socket (struct class_device *class_dev) +static int __devinit pccard_sysfs_add_socket (struct class_device *class_dev, +struct class_interface *class_intf) {struct class_device_attribute **attr;int ret =0 ;
@@ -357,7 +358,8 @@ static int __devinit pccard_sysfs_add_soreturn ret; } -static void __devexit pccard_sysfs_remove_socket(struct class_device *class_dev) +static void __devexit pccard_sysfs_remove_socket(struct class_device *class_dev, +struct class_interface *class_intf) {struct class_device_attribute **attr;
drivers/scsi/sg.c +4 -4
@@ -104,8 +104,8 @@ static int sg_allow_dio = SG_ALLOW_DIO_D#define SG_DEV_ARR_LUMP 32/* amount to over allocate sg_dev_arr by */ -static int sg_add (struct class_device *); -static void sg_remove (struct class_device *); +static int sg_add (struct class_device *,struct class_interface *); +static void sg_remove (struct class_device *,struct class_interface *);static Scsi_Request *dummy_cmdp;/* only used for sizeof */
@@ -1506,7 +1506,7 @@ static int sg_alloc(struct gendisk *disk }static int -sg_add (struct class_device *cl_dev) +sg_add (struct class_device *cl_dev,struct class_interface *cl_intf) {struct scsi_device *scsidp =to_scsi_device (cl_dev->dev);struct gendisk *disk;
@@ -1582,7 +1582,7 @@ out: }static void -sg_remove (struct class_device *cl_dev) +sg_remove (struct class_device *cl_dev,struct class_interface *cl_intf) {struct scsi_device *scsidp =to_scsi_device (cl_dev->dev);Sg_device *sdp =NULL ;
include/linux/device.h +2 -2
@@ -251,8 +251,8 @@ struct class_interface {struct list_head node;struct class *class; -int (*add) (struct class_device *); -void (*remove) (struct class_device *); +int (*add) (struct class_device *,struct class_interface *); +void (*remove) (struct class_device *,struct class_interface *); };extern int class_interface_register (struct class_interface *);
PATCH 1/1 Driver Core: add the ability for class_device structures to be nested
In reply to Greg KH[PATCH] Driver Core: add the ability for class_device structures to be nested
This patch allows struct class_device to be nested, so that another struct class_device can be the parent of a new one, instead of only having the struct class be the parent. This will allow us to (hopefully) fix up the input and video class subsystem mess.
But please people, don't go crazy and start making huge trees of class devices, you should only need 2 levels deep to get everything to work (remember to use a class_interface to get notification of a new class device being added to the system.)
Oh, this also allows us to have the possibility of potentially, someday, moving /sys/block into /sys/class. The main hindrance is that pesky /dev numberspace issue...
---
commit a82c307b63c2e516090c702ed409cb89ef633a1c
tree 51f0bd8fd7cb2204d2d0826f50fc8672b2fe9169
parent d54bc6daa47cc8821fee219877916b32119ab919
author Greg Kroah-Hartman <[email protected]> Thu, 27 Oct 2005 22:25:43 -0700 committer Greg Kroah-Hartman <[email protected]> Thu, 27 Oct 2005 22:48:01 -0700
drivers/base/class.c | 125 +++++++++++++++++++++++++++++++----------------- include/linux/device.h | 13 ++++- 2 files changed, 91 insertions(+), 47 deletions(-)
drivers/base/class.c +81 -44
@@ -99,7 +99,8 @@ struct class * class_get(struct class *void class_put (struct class * cls) { -subsys_put (&cls->subsys); +if (cls) +subsys_put (&cls->subsys); }
@@ -165,14 +166,25 @@ void class_unregister(struct class * clsstatic void class_create_release (struct class *cls) { +pr_debug ("%s called for %s\n" , __FUNCTION__, cls->name);kfree (cls); }static void class_device_create_release (struct class_device *class_dev) { +pr_debug ("%s called for %s\n" , __FUNCTION__, class_dev->class_id);kfree (class_dev); } +/* needed to allow these devices to have parent class devices */ +static int class_device_create_hotplug (struct class_device *class_dev, +char **envp,int num_envp, +char *buffer,int buffer_size) +{ +pr_debug ("%s called for %s\n" , __FUNCTION__, class_dev->class_id); +return 0 ; +} +/** * class_create - create a struct class structure * @owner: pointer to the module that is to "own" this struct class
@@ -301,10 +313,12 @@ static void class_dev_release(struct kobkfree (cd->devt_attr); cd->devt_attr =NULL ; -if (cls->release) +if (cd->release) + cd->release (cd); +else if (cls->release) cls->release (cd);else { -printk (KERN_ERR "Device class '%s' does not have a release() function, " +printk (KERN_ERR "Class Device '%s' does not have a release() function, " "it is broken and must be fixed.\n" , cd->class_id);WARN_ON (1 );
@@ -382,14 +396,18 @@ static int class_hotplug(struct kset *ks buffer = &buffer[length]; buffer_size -= length; -if (class_dev->class->hotplug) { -/* have the bus specific function add its stuff */ - retval = class_dev->class->hotplug (class_dev, envp, num_envp, - buffer, buffer_size); -if (retval) { -pr_debug ("%s - hotplug() returned %d\n" , - __FUNCTION__, retval); - } +if (class_dev->hotplug) { +/* have the class device specific function add its stuff */ + retval = class_dev->hotplug (class_dev, envp, num_envp, + buffer, buffer_size); +if (retval) +pr_debug ("class_dev->hotplug() returned %d\n" , retval); + }else if (class_dev->class->hotplug) { +/* have the class specific function add its stuff */ + retval = class_dev->class->hotplug (class_dev, envp, num_envp, + buffer, buffer_size); +if (retval) +pr_debug ("class->hotplug() returned %d\n" , retval); }return retval;
@@ -476,37 +494,42 @@ static char *make_class_name(struct clasint class_device_add (struct class_device *class_dev) { -struct class * parent =NULL ; -struct class_interface * class_intf; +struct class *parent_class =NULL ; +struct class_device *parent_class_dev =NULL ; +struct class_interface *class_intf;char *class_name =NULL ; -int error; +int error = -EINVAL ; class_dev =class_device_get (class_dev);if (!class_dev)return -EINVAL ; -if (!strlen (class_dev->class_id)) { - error = -EINVAL ; +if (!strlen (class_dev->class_id)) goto register_done; - } - parent =class_get (class_dev->class); + parent_class =class_get (class_dev->class); +if (!parent_class) + goto register_done; + parent_class_dev =class_device_get (class_dev->parent);pr_debug ("CLASS: registering class device: ID = '%s'\n" , class_dev->class_id);/* first, register with generic layer. */ kobject_set_name (&class_dev->kobj,"%s" , class_dev->class_id); -if (parent) - class_dev->kobj.parent = &parent->subsys.kset.kobj; +if (parent_class_dev) + class_dev->kobj.parent = &parent_class_dev->kobj; +else + class_dev->kobj.parent = &parent_class->subsys.kset.kobj; -if ((error =kobject_add (&class_dev->kobj))) + error =kobject_add (&class_dev->kobj); +if (error) goto register_done;/* add the needed attributes to this device */ class_dev->uevent_attr.attr.name ="uevent" ; class_dev->uevent_attr.attr.mode =S_IWUSR ; - class_dev->uevent_attr.attr.owner = parent->owner; + class_dev->uevent_attr.attr.owner = parent_class->owner; class_dev->uevent_attr.store = store_uevent;class_device_create_file (class_dev, &class_dev->uevent_attr);
@@ -520,7 +543,7 @@ int class_device_add(struct class_device } attr->attr.name ="dev" ; attr->attr.mode =S_IRUGO ; - attr->attr.owner = parent->owner; + attr->attr.owner = parent_class->owner; attr->show = show_dev;class_device_create_file (class_dev, attr); class_dev->devt_attr = attr;
@@ -538,18 +561,20 @@ int class_device_add(struct class_devicekobject_hotplug (&class_dev->kobj,KOBJ_ADD );/* notify any interfaces this device is now here */ -if (parent) { -down (&parent->sem); -list_add_tail (&class_dev->node, &parent->children); -list_for_each_entry (class_intf, &parent->interfaces, node) +if (parent_class) { +down (&parent_class->sem); +list_add_tail (&class_dev->node, &parent_class->children); +list_for_each_entry (class_intf, &parent_class->interfaces, node)if (class_intf->add) class_intf->add (class_dev, class_intf); -up (&parent->sem); +up (&parent_class->sem); } register_done: -if (error && parent) -class_put (parent); +if (error) { +class_put (parent_class); +class_device_put (parent_class_dev); + }class_device_put (class_dev);kfree (class_name);return error;
@@ -564,21 +589,28 @@ int class_device_register(struct class_d/** * class_device_create - creates a class device and registers it with sysfs * @cs: pointer to the struct class that this device should be registered to. +* @parent: pointer to the parent struct class_device of this new device, if any. * @dev: the dev_t for the char device to be added. * @device: a pointer to a struct device that is assiociated with this class device. * @fmt: string for the class device's name * * This function can be used by char device classes. A struct * class_device will be created in sysfs, registered to the specified -* class. A "dev" file will be created, showing the dev_t for the -* device. The pointer to the struct class_device will be returned from -* the call. Any further sysfs files that might be required can be -* created using this pointer. +* class. +* A "dev" file will be created, showing the dev_t for the device, if +* the dev_t is not 0,0. +* If a pointer to a parent struct class_device is passed in, the newly +* created struct class_device will be a child of that device in sysfs. +* The pointer to the struct class_device will be returned from the +* call. Any further sysfs files that might be required can be created +* using this pointer. * * Note: the struct class passed to this function must have previously * been created with a call to class_create(). */ -struct class_device *class_device_create (struct class *cls,dev_t devt, +struct class_device *class_device_create (struct class *cls, +struct class_device *parent, +dev_t devt,struct device *device,char *fmt, ...) {va_list args;
@@ -597,6 +629,9 @@ struct class_device *class_device_create class_dev->devt = devt; class_dev->dev = device; class_dev->class = cls; + class_dev->parent = parent; + class_dev->release = class_device_create_release; + class_dev->hotplug = class_device_create_hotplug;va_start (args, fmt);vsnprintf (class_dev->class_id,BUS_ID_SIZE , fmt, args);
@@ -614,17 +649,18 @@ error:void class_device_del (struct class_device *class_dev) { -struct class * parent = class_dev->class; -struct class_interface * class_intf; +struct class *parent_class = class_dev->class; +struct class_device *parent_device = class_dev->parent; +struct class_interface *class_intf;char *class_name =NULL ; -if (parent) { -down (&parent->sem); +if (parent_class) { +down (&parent_class->sem);list_del_init (&class_dev->node); -list_for_each_entry (class_intf, &parent->interfaces, node) +list_for_each_entry (class_intf, &parent_class->interfaces, node)if (class_intf->remove) class_intf->remove (class_dev, class_intf); -up (&parent->sem); +up (&parent_class->sem); }if (class_dev->dev) {
@@ -640,8 +676,8 @@ void class_device_del(struct class_devickobject_hotplug (&class_dev->kobj,KOBJ_REMOVE );kobject_del (&class_dev->kobj); -if (parent) -class_put (parent); +class_device_put (parent_device); +class_put (parent_class);kfree (class_name); }
@@ -721,7 +757,8 @@ struct class_device * class_device_get(svoid class_device_put (struct class_device *class_dev) { -kobject_put (&class_dev->kobj); +if (class_dev) +kobject_put (&class_dev->kobj); }
include/linux/device.h +10 -3
@@ -213,7 +213,11 @@ struct class_device {struct class_device_attribute uevent_attr;struct device * dev;/* not necessary, but nice to have */ void * class_data;/* class-specific data */ +struct class_device *parent;/* parent of this child device, if there is one */ +void (*release)(struct class_device *dev); +int (*hotplug)(struct class_device *dev,char **envp, +int num_envp,char *buffer,int buffer_size);char class_id[BUS_ID_SIZE ];/* unique to this class */ };
@@ -261,9 +265,12 @@ extern void class_interface_unregister(sextern struct class *class_create (struct module *owner,char *name);extern void class_destroy (struct class *cls); -extern struct class_device *class_device_create (struct class *cls,dev_t devt, -struct device *device,char *fmt, ...) - __attribute__((format (printf,4 ,5 ))); +extern struct class_device *class_device_create (struct class *cls, +struct class_device *parent, +dev_t devt, +struct device *device, +char *fmt, ...) + __attribute__((format (printf,5 ,6 )));extern void class_device_destroy (struct class *cls,dev_t devt);
PATCH 1/1 I2O: Clean up some pretty bad driver model abuses in the i2o code
In reply to Greg KH[PATCH] I2O: Clean up some pretty bad driver model abuses in the i2o code
---
commit 3d7eba1bed51352c3bd68b4e507c021ad7db928a
tree 39f070d720ed7ab91e9ebd178e345cdbb2ce5193
parent e12574538ea88cd5e15d7135e9ae6e267d314f2c
author Greg Kroah-Hartman <[email protected]> Thu, 27 Oct 2005 22:25:43 -0700 committer Greg Kroah-Hartman <[email protected]> Thu, 27 Oct 2005 22:48:00 -0700
drivers/message/i2o/iop.c | 22 ++++++++++------------ include/linux/i2o.h | 2 +- 2 files changed, 11 insertions(+), 13 deletions(-)
drivers/message/i2o/iop.c +10 -12
@@ -833,6 +833,7 @@ void i2o_iop_remove(struct i2o_controllelist_for_each_entry_safe (dev, tmp, &c->devices, list)i2o_device_remove (dev); +class_device_unregister (c->classdev);device_del (&c->device);/* Ask the IOP to switch to RESET state */
@@ -1077,9 +1078,7 @@ static void i2o_iop_release(struct devic };/* I2O controller class */ -static struct class i2o_controller_class = { - .name ="i2o_controller" , -}; +static struct class *i2o_controller_class;/** * i2o_iop_alloc - Allocate and initialize a i2o_controller struct
@@ -1110,14 +1109,10 @@ struct i2o_controller *i2o_iop_alloc(voisprintf (c->name,"iop%d" , c->unit);device_initialize (&c->device); -class_device_initialize (&c->classdev); c->device.release = &i2o_iop_release; - c->classdev.class = &i2o_controller_class; - c->classdev.dev = &c->device;snprintf (c->device.bus_id,BUS_ID_SIZE ,"iop%d" , c->unit); -snprintf (c->classdev.class_id,BUS_ID_SIZE ,"iop%d" , c->unit);#if BITS_PER_LONG ==64 spin_lock_init (&c->context_list_lock);
@@ -1146,7 +1141,9 @@ int i2o_iop_add(struct i2o_controller *c goto iop_reset; } -if ((rc =class_device_add (&c->classdev))) { + c->classdev =class_device_create (i2o_controller_class,0 , + &c->device,"iop%d" , c->unit); +if (IS_ERR (c->classdev)) {osm_err ("%s: could not add controller class\n" , c->name); goto device_del; }
@@ -1184,7 +1181,7 @@ int i2o_iop_add(struct i2o_controller *creturn 0 ; class_del: -class_device_del (&c->classdev); +class_device_unregister (c->classdev); device_del:device_del (&c->device);
@@ -1250,7 +1247,8 @@ static int __init i2o_iop_init(void)if (rc) goto exit; -if ((rc =class_register (&i2o_controller_class))) { + i2o_controller_class =class_create (THIS_MODULE ,"i2o_controller" ); +if (IS_ERR (i2o_controller_class)) {osm_err ("can't register class i2o_controller\n" ); goto device_exit; }
@@ -1273,7 +1271,7 @@ static int __init i2o_iop_init(void)i2o_driver_exit (); class_exit: -class_unregister (&i2o_controller_class); +class_destroy (i2o_controller_class); device_exit:i2o_device_exit ();
@@ -1292,7 +1290,7 @@ static void __exit i2o_iop_exit(void)i2o_pci_exit ();i2o_exec_exit ();i2o_driver_exit (); -class_unregister (&i2o_controller_class); +class_destroy (i2o_controller_class);i2o_device_exit (); };
include/linux/i2o.h +1 -1
@@ -194,7 +194,7 @@ struct i2o_controller {struct resource mem_resource;/* Mem resource allocated to the IOP */ struct device device; -struct class_device classdev;/* I2O controller class */ +struct class_device *classdev;/* I2O controller class device */ struct i2o_device *exec;/* Executive */ #if BITS_PER_LONG ==64 spinlock_t context_list_lock;/* lock for context_list */
PATCH 1/1 Driver Core: fix up all callers of class_device_create()
In reply to Greg KH[PATCH] Driver Core: fix up all callers of class_device_create()
The previous patch adding the ability to nest struct class_device changed the paramaters to the call class_device_create(). This patch fixes up all in-kernel users of the function.
---
commit c5d4abda2b87357d5ba32b0c8babb532eb75d9c7
tree 0e91246ed9a9a2e8e057e553e6028afbc25bd336
parent a82c307b63c2e516090c702ed409cb89ef633a1c
author Greg Kroah-Hartman <[email protected]> Thu, 27 Oct 2005 22:25:43 -0700 committer Greg Kroah-Hartman <[email protected]> Thu, 27 Oct 2005 22:48:02 -0700
arch/i386/kernel/cpuid.c | 2 +- arch/i386/kernel/msr.c | 2 +- drivers/block/aoe/aoechr.c | 2 +- drivers/block/paride/pg.c | 2 +- drivers/block/paride/pt.c | 4 ++-- drivers/char/dsp56k.c | 2 +- drivers/char/ftape/zftape/zftape-init.c | 12 ++++++------ drivers/char/ip2main.c | 10 ++++++---- drivers/char/ipmi/ipmi_devintf.c | 2 +- drivers/char/istallion.c | 3 ++- drivers/char/lp.c | 2 +- drivers/char/mem.c | 3 ++- drivers/char/misc.c | 2 +- drivers/char/ppdev.c | 2 +- drivers/char/raw.c | 4 ++-- drivers/char/snsc.c | 2 +- drivers/char/stallion.c | 4 +++- drivers/char/tipar.c | 2 +- drivers/char/tty_io.c | 10 +++++----- drivers/char/vc_screen.c | 10 ++++++---- drivers/char/viotape.c | 4 ++-- drivers/hwmon/hwmon.c | 2 +- drivers/ide/ide-tape.c | 4 ++-- drivers/ieee1394/dv1394.c | 2 +- drivers/ieee1394/raw1394.c | 2 +- drivers/ieee1394/video1394.c | 2 +- drivers/infiniband/core/ucm.c | 2 +- drivers/input/evdev.c | 2 +- drivers/input/joydev.c | 2 +- drivers/input/mousedev.c | 4 ++-- drivers/input/tsdev.c | 2 +- drivers/isdn/capi/capi.c | 2 +- drivers/macintosh/adb.c | 2 +- drivers/media/dvb/dvb-core/dvbdev.c | 2 +- drivers/message/i2o/iop.c | 2 +- drivers/mtd/mtdchar.c | 4 ++-- drivers/net/ppp_generic.c | 2 +- drivers/net/wan/cosa.c | 2 +- drivers/s390/char/tape_class.c | 1 + drivers/s390/char/vmlogrdr.c | 1 + drivers/scsi/ch.c | 2 +- drivers/scsi/osst.c | 2 +- drivers/scsi/sg.c | 2 +- drivers/scsi/st.c | 2 +- drivers/usb/core/devio.c | 2 +- drivers/usb/core/file.c | 4 +++- drivers/usb/core/hcd.c | 3 ++- drivers/video/fbmem.c | 2 +- fs/coda/psdev.c | 4 ++-- sound/core/sound.c | 2 +- sound/oss/soundcard.c | 4 ++-- sound/sound_core.c | 2 +- 52 files changed, 86 insertions(+), 73 deletions(-)
arch/i386/kernel/cpuid.c +1 -1
@@ -163,7 +163,7 @@ static int cpuid_class_device_create(intint err =0 ;struct class_device *class_err; - class_err =class_device_create (cpuid_class,MKDEV (CPUID_MAJOR , i),NULL ,"cpu%d" ,i); + class_err =class_device_create (cpuid_class,NULL ,MKDEV (CPUID_MAJOR , i),NULL ,"cpu%d" ,i);if (IS_ERR (class_err)) err =PTR_ERR (class_err);return err;
arch/i386/kernel/msr.c +1 -1
@@ -246,7 +246,7 @@ static int msr_class_device_create(int iint err =0 ;struct class_device *class_err; - class_err =class_device_create (msr_class,MKDEV (MSR_MAJOR , i),NULL ,"msr%d" ,i); + class_err =class_device_create (msr_class,NULL ,MKDEV (MSR_MAJOR , i),NULL ,"msr%d" ,i);if (IS_ERR (class_err)) err =PTR_ERR (class_err);return err;
drivers/block/aoe/aoechr.c +1 -1
@@ -224,7 +224,7 @@ aoechr_init(void)return PTR_ERR (aoe_class); }for (i =0 ; i <ARRAY_SIZE (chardevs); ++i) -class_device_create (aoe_class, +class_device_create (aoe_class,NULL ,MKDEV (AOE_MAJOR , chardevs[i].minor),NULL , chardevs[i].name);
drivers/block/paride/pg.c +1 -1
@@ -674,7 +674,7 @@ static int __init pg_init(void)for (unit =0 ; unit <PG_UNITS ; unit++) {struct pg *dev = &devices[unit];if (dev->present) { -class_device_create (pg_class,MKDEV (major, unit), +class_device_create (pg_class,NULL ,MKDEV (major, unit),NULL ,"pg%u" , unit); err = devfs_mk_cdev(MKDEV(major, unit), S_IFCHR | S_IRUSR | S_IWUSR, "pg/%u",
drivers/block/paride/pt.c +2 -2
@@ -971,7 +971,7 @@ static int __init pt_init(void)devfs_mk_dir ("pt" );for (unit =0 ; unit <PT_UNITS ; unit++)if (pt[unit].present) { -class_device_create (pt_class,MKDEV (major, unit), +class_device_create (pt_class,NULL ,MKDEV (major, unit),NULL ,"pt%d" , unit); err = devfs_mk_cdev(MKDEV(major, unit), S_IFCHR | S_IRUSR | S_IWUSR,
@@ -980,7 +980,7 @@ static int __init pt_init(void)class_device_destroy (pt_class,MKDEV (major, unit)); goto out_class; } -class_device_create (pt_class,MKDEV (major, unit +128 ), +class_device_create (pt_class,NULL ,MKDEV (major, unit +128 ),NULL ,"pt%dn" , unit); err = devfs_mk_cdev(MKDEV(major, unit + 128), S_IFCHR | S_IRUSR | S_IWUSR,
drivers/char/dsp56k.c +1 -1
@@ -515,7 +515,7 @@ static int __init dsp56k_init_driver(voi err =PTR_ERR (dsp56k_class); goto out_chrdev; } -class_device_create (dsp56k_class,MKDEV (DSP56K_MAJOR ,0 ),NULL ,"dsp56k" ); +class_device_create (dsp56k_class,NULL ,MKDEV (DSP56K_MAJOR ,0 ),NULL ,"dsp56k" ); err =devfs_mk_cdev (MKDEV (DSP56K_MAJOR ,0 ),S_IFCHR |S_IRUSR |S_IWUSR ,"dsp56k" );
drivers/char/ftape/zftape/zftape-init.c +6 -6
@@ -331,27 +331,27 @@ KERN_INFO zft_class =class_create (THIS_MODULE ,"zft" );for (i =0 ; i <4 ; i++) { -class_device_create (zft_class,MKDEV (QIC117_TAPE_MAJOR , i),NULL ,"qft%i" , i); +class_device_create (zft_class,NULL ,MKDEV (QIC117_TAPE_MAJOR , i),NULL ,"qft%i" , i);devfs_mk_cdev (MKDEV (QIC117_TAPE_MAJOR , i),S_IFCHR |S_IRUSR |S_IWUSR ,"qft%i" , i); -class_device_create (zft_class,MKDEV (QIC117_TAPE_MAJOR , i +4 ),NULL ,"nqft%i" , i); +class_device_create (zft_class,NULL ,MKDEV (QIC117_TAPE_MAJOR , i +4 ),NULL ,"nqft%i" , i);devfs_mk_cdev (MKDEV (QIC117_TAPE_MAJOR , i +4 ),S_IFCHR |S_IRUSR |S_IWUSR ,"nqft%i" , i); -class_device_create (zft_class,MKDEV (QIC117_TAPE_MAJOR , i +16 ),NULL ,"zqft%i" , i); +class_device_create (zft_class,NULL ,MKDEV (QIC117_TAPE_MAJOR , i +16 ),NULL ,"zqft%i" , i);devfs_mk_cdev (MKDEV (QIC117_TAPE_MAJOR , i +16 ),S_IFCHR |S_IRUSR |S_IWUSR ,"zqft%i" , i); -class_device_create (zft_class,MKDEV (QIC117_TAPE_MAJOR , i +20 ),NULL ,"nzqft%i" , i); +class_device_create (zft_class,NULL ,MKDEV (QIC117_TAPE_MAJOR , i +20 ),NULL ,"nzqft%i" , i);devfs_mk_cdev (MKDEV (QIC117_TAPE_MAJOR , i +20 ),S_IFCHR |S_IRUSR |S_IWUSR ,"nzqft%i" , i); -class_device_create (zft_class,MKDEV (QIC117_TAPE_MAJOR , i +32 ),NULL ,"rawqft%i" , i); +class_device_create (zft_class,NULL ,MKDEV (QIC117_TAPE_MAJOR , i +32 ),NULL ,"rawqft%i" , i);devfs_mk_cdev (MKDEV (QIC117_TAPE_MAJOR , i +32 ),S_IFCHR |S_IRUSR |S_IWUSR ,"rawqft%i" , i); -class_device_create (zft_class,MKDEV (QIC117_TAPE_MAJOR , i +36 ),NULL ,"nrawrawqft%i" , i); +class_device_create (zft_class,NULL ,MKDEV (QIC117_TAPE_MAJOR , i +36 ),NULL ,"nrawrawqft%i" , i);devfs_mk_cdev (MKDEV (QIC117_TAPE_MAJOR , i +36 ),S_IFCHR |S_IRUSR |S_IWUSR ,"nrawqft%i" , i);
drivers/char/ip2main.c +6 -4
@@ -721,8 +721,9 @@ ip2_loadmain(int *iop, int *irqp, unsign }if (NULL != ( pB = i2BoardPtrTable[i] ) ) { -class_device_create (ip2_class,MKDEV (IP2_IPL_MAJOR , -4 * i),NULL ,"ipl%d" , i); +class_device_create (ip2_class,NULL , +MKDEV (IP2_IPL_MAJOR ,4 * i), +NULL ,"ipl%d" , i); err =devfs_mk_cdev (MKDEV (IP2_IPL_MAJOR ,4 * i),S_IRUSR |S_IWUSR |S_IRGRP |S_IFCHR ,"ip2/ipl%d" , i);
@@ -732,8 +733,9 @@ ip2_loadmain(int *iop, int *irqp, unsign goto out_class; } -class_device_create (ip2_class,MKDEV (IP2_IPL_MAJOR , -4 * i +1 ),NULL ,"stat%d" , i); +class_device_create (ip2_class,NULL , +MKDEV (IP2_IPL_MAJOR ,4 * i +1 ), +NULL ,"stat%d" , i); err =devfs_mk_cdev (MKDEV (IP2_IPL_MAJOR ,4 * i +1 ),S_IRUSR |S_IWUSR |S_IRGRP |S_IFCHR ,"ip2/stat%d" , i);
drivers/char/ipmi/ipmi_devintf.c +1 -1
@@ -798,7 +798,7 @@ static void ipmi_new_smi(int if_num)devfs_mk_cdev (dev,S_IFCHR |S_IRUSR |S_IWUSR ,"ipmidev/%d" , if_num); -class_device_create (ipmi_class, dev,NULL ,"ipmi%d" , if_num); +class_device_create (ipmi_class,NULL , dev,NULL ,"ipmi%d" , if_num); }static void ipmi_smi_gone (int if_num)
drivers/char/istallion.c +2 -1
@@ -5246,7 +5246,8 @@ int __init stli_init(void)devfs_mk_cdev (MKDEV (STL_SIOMEMMAJOR , i),S_IFCHR |S_IRUSR |S_IWUSR ,"staliomem/%d" , i); -class_device_create (istallion_class,MKDEV (STL_SIOMEMMAJOR , i), +class_device_create (istallion_class,NULL , +MKDEV (STL_SIOMEMMAJOR , i),NULL ,"staliomem%d" , i); }
drivers/char/lp.c +1 -1
@@ -805,7 +805,7 @@ static int lp_register(int nr, struct paif (reset)lp_reset (nr); -class_device_create (lp_class,MKDEV (LP_MAJOR , nr),NULL , +class_device_create (lp_class,NULL ,MKDEV (LP_MAJOR , nr),NULL ,"lp%d" , nr);devfs_mk_cdev (MKDEV (LP_MAJOR , nr),S_IFCHR |S_IRUGO |S_IWUGO ,"printers/%d" , nr);
drivers/char/mem.c +2 -1
@@ -920,7 +920,8 @@ static int __init chr_dev_init(void) mem_class =class_create (THIS_MODULE ,"mem" );for (i =0 ; i <ARRAY_SIZE (devlist); i++) { -class_device_create (mem_class,MKDEV (MEM_MAJOR , devlist[i].minor), +class_device_create (mem_class,NULL , +MKDEV (MEM_MAJOR , devlist[i].minor),NULL , devlist[i].name);devfs_mk_cdev (MKDEV (MEM_MAJOR , devlist[i].minor),S_IFCHR | devlist[i].mode, devlist[i].name);
drivers/char/misc.c +1 -1
@@ -234,7 +234,7 @@ int misc_register(struct miscdevice * mi } dev =MKDEV (MISC_MAJOR , misc->minor); - misc->class =class_device_create (misc_class, dev, misc->dev, + misc->class =class_device_create (misc_class,NULL , dev, misc->dev,"%s" , misc->name);if (IS_ERR (misc->class)) { err =PTR_ERR (misc->class);
drivers/char/ppdev.c +1 -1
@@ -752,7 +752,7 @@ static struct file_operations pp_fops =static void pp_attach (struct parport *port) { -class_device_create (ppdev_class,MKDEV (PP_MAJOR , port->number), +class_device_create (ppdev_class,NULL ,MKDEV (PP_MAJOR , port->number),NULL ,"parport%d" , port->number); }
drivers/char/raw.c +2 -2
@@ -128,7 +128,7 @@ raw_ioctl(struct inode *inode, struct fistatic void bind_device (struct raw_config_request *rq) {class_device_destroy (raw_class,MKDEV (RAW_MAJOR , rq->raw_minor)); -class_device_create (raw_class,MKDEV (RAW_MAJOR , rq->raw_minor), +class_device_create (raw_class,NULL ,MKDEV (RAW_MAJOR , rq->raw_minor),NULL ,"raw%d" , rq->raw_minor); }
@@ -307,7 +307,7 @@ static int __init raw_init(void)unregister_chrdev_region (dev,MAX_RAW_MINORS ); goto error; } -class_device_create (raw_class,MKDEV (RAW_MAJOR ,0 ),NULL ,"rawctl" ); +class_device_create (raw_class,NULL ,MKDEV (RAW_MAJOR ,0 ),NULL ,"rawctl" ); devfs_mk_cdev(MKDEV(RAW_MAJOR, 0), S_IFCHR | S_IRUGO | S_IWUGO,
drivers/char/snsc.c +1 -1
@@ -437,7 +437,7 @@ scdrv_init(void)continue ; } -class_device_create (snsc_class, dev,NULL , +class_device_create (snsc_class,NULL , dev,NULL ,"%s" , devname); ia64_sn_irtr_intr_enable(scd->scd_nasid,
drivers/char/stallion.c +3 -1
@@ -3095,7 +3095,9 @@ static int __init stl_init(void)devfs_mk_cdev (MKDEV (STL_SIOMEMMAJOR , i),S_IFCHR |S_IRUSR |S_IWUSR ,"staliomem/%d" , i); -class_device_create (stallion_class,MKDEV (STL_SIOMEMMAJOR , i),NULL ,"staliomem%d" , i); +class_device_create (stallion_class,NULL , +MKDEV (STL_SIOMEMMAJOR , i),NULL , +"staliomem%d" , i); } stl_serial->owner =THIS_MODULE ;
drivers/char/tipar.c +1 -1
@@ -436,7 +436,7 @@ tipar_register(int nr, struct parport *p goto out; } -class_device_create (tipar_class,MKDEV (TIPAR_MAJOR , +class_device_create (tipar_class,NULL ,MKDEV (TIPAR_MAJOR ,TIPAR_MINOR + nr),NULL ,"par%d" , nr);/* Use devfs, tree: /dev/ticables/par/[0..2] */ err = devfs_mk_cdev(MKDEV(TIPAR_MAJOR, TIPAR_MINOR + nr),
drivers/char/tty_io.c +5 -5
@@ -2728,7 +2728,7 @@ void tty_register_device(struct tty_drivpty_line_name (driver, index, name); elsetty_line_name (driver ,index ,name ); -class_device_create (tty_class, dev, device, name); +class_device_create (tty_class,NULL , dev, device,"%s" , name); }/**
@@ -2983,14 +2983,14 @@ static int __init tty_init(void) register_chrdev_region(MKDEV(TTYAUX_MAJOR, 0), 1, "/dev/tty") < 0)panic ("Couldn't register /dev/tty driver\n" );devfs_mk_cdev (MKDEV (TTYAUX_MAJOR ,0 ),S_IFCHR |S_IRUGO |S_IWUGO ,"tty" ); -class_device_create (tty_class,MKDEV (TTYAUX_MAJOR ,0 ),NULL ,"tty" ); +class_device_create (tty_class,NULL ,MKDEV (TTYAUX_MAJOR ,0 ),NULL ,"tty" );cdev_init (&console_cdev, &console_fops);if (cdev_add (&console_cdev,MKDEV (TTYAUX_MAJOR ,1 ),1 ) ||register_chrdev_region (MKDEV (TTYAUX_MAJOR ,1 ),1 ,"/dev/console" ) <0 )panic ("Couldn't register /dev/console driver\n" );devfs_mk_cdev (MKDEV (TTYAUX_MAJOR ,1 ),S_IFCHR |S_IRUSR |S_IWUSR ,"console" ); -class_device_create (tty_class,MKDEV (TTYAUX_MAJOR ,1 ),NULL ,"console" ); +class_device_create (tty_class,NULL ,MKDEV (TTYAUX_MAJOR ,1 ),NULL ,"console" );#ifdef CONFIG_UNIX98_PTYS cdev_init (&ptmx_cdev, &ptmx_fops);
@@ -2998,7 +2998,7 @@ static int __init tty_init(void) register_chrdev_region(MKDEV(TTYAUX_MAJOR, 2), 1, "/dev/ptmx") < 0)panic ("Couldn't register /dev/ptmx driver\n" );devfs_mk_cdev (MKDEV (TTYAUX_MAJOR ,2 ),S_IFCHR |S_IRUGO |S_IWUGO ,"ptmx" ); -class_device_create (tty_class,MKDEV (TTYAUX_MAJOR ,2 ),NULL ,"ptmx" ); +class_device_create (tty_class,NULL ,MKDEV (TTYAUX_MAJOR ,2 ),NULL ,"ptmx" );#endif #ifdef CONFIG_VT
@@ -3007,7 +3007,7 @@ static int __init tty_init(void) register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/vc/0") < 0)panic ("Couldn't register /dev/tty0 driver\n" );devfs_mk_cdev (MKDEV (TTY_MAJOR ,0 ),S_IFCHR |S_IRUSR |S_IWUSR ,"vc/0" ); -class_device_create (tty_class,MKDEV (TTY_MAJOR ,0 ),NULL ,"tty0" ); +class_device_create (tty_class,NULL ,MKDEV (TTY_MAJOR ,0 ),NULL ,"tty0" );vty_init ();#endif
drivers/char/vc_screen.c +6 -4
@@ -484,8 +484,10 @@ void vcs_make_devfs(struct tty_struct *tdevfs_mk_cdev (MKDEV (VCS_MAJOR , tty->index +129 ),S_IFCHR |S_IRUSR |S_IWUSR ,"vcc/a%u" , tty->index +1 ); -class_device_create (vc_class,MKDEV (VCS_MAJOR , tty->index +1 ),NULL ,"vcs%u" , tty->index +1 ); -class_device_create (vc_class,MKDEV (VCS_MAJOR , tty->index +129 ),NULL ,"vcsa%u" , tty->index +1 ); +class_device_create (vc_class,NULL ,MKDEV (VCS_MAJOR , tty->index +1 ), +NULL ,"vcs%u" , tty->index +1 ); +class_device_create (vc_class,NULL ,MKDEV (VCS_MAJOR , tty->index +129 ), +NULL ,"vcsa%u" , tty->index +1 ); }void vcs_remove_devfs (struct tty_struct *tty) {
@@ -503,7 +505,7 @@ int __init vcs_init(void)devfs_mk_cdev (MKDEV (VCS_MAJOR ,0 ),S_IFCHR |S_IRUSR |S_IWUSR ,"vcc/0" );devfs_mk_cdev (MKDEV (VCS_MAJOR ,128 ),S_IFCHR |S_IRUSR |S_IWUSR ,"vcc/a0" ); -class_device_create (vc_class,MKDEV (VCS_MAJOR ,0 ),NULL ,"vcs" ); -class_device_create (vc_class,MKDEV (VCS_MAJOR ,128 ),NULL ,"vcsa" ); +class_device_create (vc_class,NULL ,MKDEV (VCS_MAJOR ,0 ),NULL ,"vcs" ); +class_device_create (vc_class,NULL ,MKDEV (VCS_MAJOR ,128 ),NULL ,"vcsa" );return 0 ; }
drivers/char/viotape.c +2 -2
@@ -956,9 +956,9 @@ static int viotape_probe(struct vio_dev state[i].cur_part =0 ;for (j =0 ; j <MAX_PARTITIONS ; ++j) state[i].part_stat_rwi[j] =VIOT_IDLE ; -class_device_create (tape_class,MKDEV (VIOTAPE_MAJOR , i),NULL , +class_device_create (tape_class,NULL ,MKDEV (VIOTAPE_MAJOR , i),NULL ,"iseries!vt%d" , i); -class_device_create (tape_class,MKDEV (VIOTAPE_MAJOR , i |0x80 ), +class_device_create (tape_class,NULL ,MKDEV (VIOTAPE_MAJOR , i |0x80 ),NULL ,"iseries!nvt%d" , i);devfs_mk_cdev (MKDEV (VIOTAPE_MAJOR , i),S_IFCHR |S_IRUSR |S_IWUSR ,"iseries/vt%d" , i);
drivers/hwmon/hwmon.c +1 -1
@@ -45,7 +45,7 @@ struct class_device *hwmon_device_registreturn ERR_PTR (-ENOMEM ); id = id &MAX_ID_MASK ; - cdev =class_device_create (hwmon_class,MKDEV (0 ,0 ), dev, + cdev =class_device_create (hwmon_class,NULL ,MKDEV (0 ,0 ), dev,HWMON_ID_FORMAT , id);if (IS_ERR (cdev))
drivers/ide/ide-tape.c +2 -2
@@ -4884,9 +4884,9 @@ static int ide_tape_probe(struct deviceidetape_setup (drive, tape, minor); -class_device_create (idetape_sysfs_class, +class_device_create (idetape_sysfs_class,NULL ,MKDEV (IDETAPE_MAJOR , minor), dev,"%s" , tape->name); -class_device_create (idetape_sysfs_class, +class_device_create (idetape_sysfs_class,NULL ,MKDEV (IDETAPE_MAJOR , minor +128 ), dev,"n%s" , tape->name); devfs_mk_cdev(MKDEV(HWIF(drive)->major, minor),
drivers/ieee1394/dv1394.c +1 -1
@@ -2361,7 +2361,7 @@ static void dv1394_add_host (struct hpsb ohci = (struct ti_ohci *)host->hostdata; -class_device_create (hpsb_protocol_class,MKDEV ( +class_device_create (hpsb_protocol_class,NULL ,MKDEV (IEEE1394_MAJOR ,IEEE1394_MINOR_BLOCK_DV1394 *16 + (id<<2 )),NULL ,"dv1394-%d" , id);devfs_mk_dir ("ieee1394/dv/host%d" , id);
drivers/ieee1394/raw1394.c +1 -1
@@ -2912,7 +2912,7 @@ static int __init init_raw1394(void)hpsb_register_highlevel (&raw1394_highlevel); -if (IS_ERR (class_device_create (hpsb_protocol_class,MKDEV ( +if (IS_ERR (class_device_create (hpsb_protocol_class,NULL ,MKDEV (IEEE1394_MAJOR ,IEEE1394_MINOR_BLOCK_RAW1394 *16 ),NULL ,RAW1394_DEVICE_NAME ))) { ret = -EFAULT ;
drivers/ieee1394/video1394.c +1 -1
@@ -1370,7 +1370,7 @@ static void video1394_add_host (struct hhpsb_set_hostinfo_key (&video1394_highlevel, host, ohci->host->id); minor =IEEE1394_MINOR_BLOCK_VIDEO1394 *16 + ohci->host->id; -class_device_create (hpsb_protocol_class,MKDEV ( +class_device_create (hpsb_protocol_class,NULL ,MKDEV (IEEE1394_MAJOR , minor),NULL ,"%s-%d" ,VIDEO1394_DRIVER_NAME , ohci->host->id); devfs_mk_cdev(MKDEV(IEEE1394_MAJOR, minor),
drivers/infiniband/core/ucm.c +1 -1
@@ -1300,7 +1300,7 @@ static int __init ib_ucm_init(void) goto err_class; } -class_device_create (ib_ucm_class,IB_UCM_DEV ,NULL ,"ucm" ); +class_device_create (ib_ucm_class,NULL ,IB_UCM_DEV ,NULL ,"ucm" );idr_init (&ctx_id_table);init_MUTEX (&ctx_id_mutex);
drivers/input/evdev.c +1 -1
@@ -689,7 +689,7 @@ static struct input_handle *evdev_connecdevfs_mk_cdev (MKDEV (INPUT_MAJOR ,EVDEV_MINOR_BASE + minor),S_IFCHR |S_IRUGO |S_IWUSR ,"input/event%d" , minor); -class_device_create (input_class, +class_device_create (input_class,NULL ,MKDEV (INPUT_MAJOR ,EVDEV_MINOR_BASE + minor), dev->dev,"event%d" , minor);
drivers/input/joydev.c +1 -1
@@ -516,7 +516,7 @@ static struct input_handle *joydev_connedevfs_mk_cdev (MKDEV (INPUT_MAJOR ,JOYDEV_MINOR_BASE + minor),S_IFCHR |S_IRUGO |S_IWUSR ,"input/js%d" , minor); -class_device_create (input_class, +class_device_create (input_class,NULL ,MKDEV (INPUT_MAJOR ,JOYDEV_MINOR_BASE + minor), dev->dev,"js%d" , minor);
drivers/input/mousedev.c +2 -2
@@ -651,7 +651,7 @@ static struct input_handle *mousedev_condevfs_mk_cdev (MKDEV (INPUT_MAJOR ,MOUSEDEV_MINOR_BASE + minor),S_IFCHR |S_IRUGO |S_IWUSR ,"input/mouse%d" , minor); -class_device_create (input_class, +class_device_create (input_class,NULL ,MKDEV (INPUT_MAJOR ,MOUSEDEV_MINOR_BASE + minor), dev->dev,"mouse%d" , minor);
@@ -740,7 +740,7 @@ static int __init mousedev_init(void)devfs_mk_cdev (MKDEV (INPUT_MAJOR ,MOUSEDEV_MINOR_BASE +MOUSEDEV_MIX ),S_IFCHR |S_IRUGO |S_IWUSR ,"input/mice" ); -class_device_create (input_class, +class_device_create (input_class,NULL ,MKDEV (INPUT_MAJOR ,MOUSEDEV_MINOR_BASE +MOUSEDEV_MIX ),NULL ,"mice" );#ifdef CONFIG_INPUT_MOUSEDEV_PSAUX
drivers/input/tsdev.c +1 -1
@@ -414,7 +414,7 @@ static struct input_handle *tsdev_connec S_IFCHR|S_IRUGO|S_IWUSR, "input/ts%d", minor);devfs_mk_cdev (MKDEV (INPUT_MAJOR ,TSDEV_MINOR_BASE + minor +TSDEV_MINORS /2 ),S_IFCHR |S_IRUGO |S_IWUSR ,"input/tsraw%d" , minor); -class_device_create (input_class, +class_device_create (input_class,NULL ,MKDEV (INPUT_MAJOR ,TSDEV_MINOR_BASE + minor), dev->dev,"ts%d" , minor);
drivers/isdn/capi/capi.c +1 -1
@@ -1505,7 +1505,7 @@ static int __init capi_init(void)return PTR_ERR (capi_class); } -class_device_create (capi_class,MKDEV (capi_major,0 ),NULL ,"capi" ); +class_device_create (capi_class,NULL ,MKDEV (capi_major,0 ),NULL ,"capi" );devfs_mk_cdev (MKDEV (capi_major,0 ),S_IFCHR |S_IRUSR |S_IWUSR ,"isdn/capi20" );
drivers/macintosh/adb.c +1 -1
@@ -905,5 +905,5 @@ adbdev_init(void) adb_dev_class =class_create (THIS_MODULE ,"adb" );if (IS_ERR (adb_dev_class))return ; -class_device_create (adb_dev_class,MKDEV (ADB_MAJOR ,0 ),NULL ,"adb" ); +class_device_create (adb_dev_class,NULL ,MKDEV (ADB_MAJOR ,0 ),NULL ,"adb" ); }
drivers/media/dvb/dvb-core/dvbdev.c +1 -1
@@ -235,7 +235,7 @@ int dvb_register_device(struct dvb_adaptS_IFCHR |S_IRUSR |S_IWUSR , "dvb/adapter%d/%s%d", adap->num, dnames[type], id); -class_device_create (dvb_class,MKDEV (DVB_MAJOR ,nums2minor (adap->num, type, id)), +class_device_create (dvb_class,NULL ,MKDEV (DVB_MAJOR ,nums2minor (adap->num, type, id)),NULL ,"dvb%d.%s%d" , adap->num, dnames[type], id); dprintk("DVB: register adapter%d/%s%d @ minor: %i (0x%02x)\n",
drivers/message/i2o/iop.c +1 -1
@@ -1141,7 +1141,7 @@ int i2o_iop_add(struct i2o_controller *c goto iop_reset; } - c->classdev =class_device_create (i2o_controller_class,0 , + c->classdev =class_device_create (i2o_controller_class,NULL ,MKDEV (0 ,0 ), &c->device,"iop%d" , c->unit);if (IS_ERR (c->classdev)) {osm_err ("%s: could not add controller class\n" , c->name);
drivers/mtd/mtdchar.c +2 -2
@@ -24,10 +24,10 @@ static void mtd_notify_add(struct mtd_inif (!mtd)return ; -class_device_create (mtd_class,MKDEV (MTD_CHAR_MAJOR , mtd->index*2 ), +class_device_create (mtd_class,NULL ,MKDEV (MTD_CHAR_MAJOR , mtd->index*2 ),NULL ,"mtd%d" , mtd->index); -class_device_create (mtd_class, +class_device_create (mtd_class,NULL ,MKDEV (MTD_CHAR_MAJOR , mtd->index*2 +1 ),NULL ,"mtd%dro" , mtd->index); }
drivers/net/ppp_generic.c +1 -1
@@ -863,7 +863,7 @@ static int __init ppp_init(void) err =PTR_ERR (ppp_class); goto out_chrdev; } -class_device_create (ppp_class,MKDEV (PPP_MAJOR ,0 ),NULL ,"ppp" ); +class_device_create (ppp_class,NULL ,MKDEV (PPP_MAJOR ,0 ),NULL ,"ppp" ); err =devfs_mk_cdev (MKDEV (PPP_MAJOR ,0 ),S_IFCHR |S_IRUSR |S_IWUSR ,"ppp" );if (err)
drivers/net/wan/cosa.c +1 -1
@@ -400,7 +400,7 @@ static int __init cosa_init(void) goto out_chrdev; }for (i=0 ; i<nr_cards; i++) { -class_device_create (cosa_class,MKDEV (cosa_major, i), +class_device_create (cosa_class,NULL ,MKDEV (cosa_major, i),NULL ,"cosa%d" , i); err = devfs_mk_cdev(MKDEV(cosa_major, i), S_IFCHR|S_IRUSR|S_IWUSR,
drivers/s390/char/tape_class.c +1 -0
@@ -72,6 +72,7 @@ struct tape_class_device *register_tape_ tcd->class_device =class_device_create ( tape_class, +NULL , tcd->char_device->dev, device, "%s", tcd->device_name
drivers/s390/char/vmlogrdr.c +1 -0
@@ -787,6 +787,7 @@ vmlogrdr_register_device(struct vmlogrdrreturn ret; } priv->class_device = class_device_create( + NULL, vmlogrdr_class, MKDEV(vmlogrdr_major, priv->minor_num), dev,
drivers/scsi/ch.c +1 -1
@@ -936,7 +936,7 @@ static int ch_probe(struct device *dev)if (init)ch_init_elem (ch); -class_device_create (ch_sysfs_class, +class_device_create (ch_sysfs_class,NULL ,MKDEV (SCSI_CHANGER_MAJOR ,ch->minor), dev,"s%s" , ch->name);
drivers/scsi/osst.c +1 -1
@@ -5627,7 +5627,7 @@ static void osst_sysfs_add(dev_t dev, stif (!osst_sysfs_valid)return ; - osst_class_member =class_device_create (osst_sysfs_class, dev, device,"%s" , name); + osst_class_member =class_device_create (osst_sysfs_class,NULL , dev, device,"%s" , name);if (IS_ERR (osst_class_member)) {printk (KERN_WARNING "osst :W: Unable to add sysfs class member %s\n" , name);return ;
drivers/scsi/sg.c +1 -1
@@ -1550,7 +1550,7 @@ sg_add(struct class_device *cl_dev, struif (sg_sysfs_valid) {struct class_device * sg_class_member; - sg_class_member =class_device_create (sg_sysfs_class, + sg_class_member =class_device_create (sg_sysfs_class,NULL ,MKDEV (SCSI_GENERIC_MAJOR , k), cl_dev->dev,"%s" , disk->disk_name);
drivers/scsi/st.c +1 -1
@@ -4375,7 +4375,7 @@ static void do_create_class_files(structsnprintf (name,10 ,"%s%s%s" , rew ?"n" :"" , STp->disk->disk_name, st_formats[i]); st_class_member = -class_device_create (st_sysfs_class, +class_device_create (st_sysfs_class,NULL ,MKDEV (SCSI_TAPE_MAJOR ,TAPE_MINOR (dev_num, mode, rew)), &STp->device->sdev_gendev,"%s" , name);
drivers/usb/core/devio.c +1 -1
@@ -1509,7 +1509,7 @@ void usbdev_add(struct usb_device *dev) {int minor = ((dev->bus->busnum-1 ) *128 ) + (dev->devnum-1 ); - dev->class_dev =class_device_create (usb_device_class, + dev->class_dev =class_device_create (usb_device_class,NULL ,MKDEV (USB_DEVICE_MAJOR , minor), &dev->dev,"usbdev%d.%d" , dev->bus->busnum, dev->devnum);
drivers/usb/core/file.c +3 -1
@@ -172,7 +172,9 @@ int usb_register_dev(struct usb_interfac ++temp; else temp = name; - intf->class_dev =class_device_create (usb_class,MKDEV (USB_MAJOR , minor), &intf->dev,"%s" , temp); + intf->class_dev =class_device_create (usb_class,NULL , +MKDEV (USB_MAJOR , minor), + &intf->dev,"%s" , temp);if (IS_ERR (intf->class_dev)) {spin_lock (&minor_lock); usb_minors[intf->minor] =NULL ;
drivers/usb/core/hcd.c +2 -1
@@ -782,7 +782,8 @@ static int usb_register_bus(struct usb_breturn -E2BIG ; } - bus->class_dev =class_device_create (usb_host_class,MKDEV (0 ,0 ), bus->controller,"usb_host%d" , busnum); + bus->class_dev =class_device_create (usb_host_class,NULL ,MKDEV (0 ,0 ), + bus->controller,"usb_host%d" , busnum);if (IS_ERR (bus->class_dev)) {clear_bit (busnum, busmap.busmap);up (&usb_bus_list_lock);
drivers/video/fbmem.c +1 -1
@@ -1031,7 +1031,7 @@ register_framebuffer(struct fb_info *fb_break ; fb_info->node = i; - fb_info->class_device =class_device_create (fb_class,MKDEV (FB_MAJOR , i), + fb_info->class_device =class_device_create (fb_class,NULL ,MKDEV (FB_MAJOR , i), fb_info->device,"fb%d" , i);if (IS_ERR (fb_info->class_device)) {/* Not fatal */
fs/coda/psdev.c +2 -2
@@ -370,8 +370,8 @@ static int init_coda_psdev(void) }devfs_mk_dir ("coda" );for (i =0 ; i <MAX_CODADEVS ; i++) { -class_device_create (coda_psdev_class,MKDEV (CODA_PSDEV_MAJOR ,i), -NULL ,"cfs%d" , i); +class_device_create (coda_psdev_class,NULL , +MKDEV (CODA_PSDEV_MAJOR ,i),NULL ,"cfs%d" , i); err =devfs_mk_cdev (MKDEV (CODA_PSDEV_MAJOR , i),S_IFCHR |S_IRUSR |S_IWUSR ,"coda/%d" , i);if (err)
sound/core/sound.c +1 -1
@@ -231,7 +231,7 @@ int snd_register_device(int type, snd_cadevfs_mk_cdev (MKDEV (major, minor),S_IFCHR | device_mode,"snd/%s" , name);if (card) device = card->dev; -class_device_create (sound_class,MKDEV (major, minor), device,"%s" , name); +class_device_create (sound_class,NULL ,MKDEV (major, minor), device,"%s" , name);up (&sound_mutex);return 0 ;
sound/oss/soundcard.c +2 -2
@@ -567,7 +567,7 @@ static int __init oss_init(void)devfs_mk_cdev (MKDEV (SOUND_MAJOR , dev_list[i].minor),S_IFCHR | dev_list[i].mode,"sound/%s" , dev_list[i].name); -class_device_create (sound_class, +class_device_create (sound_class,NULL ,MKDEV (SOUND_MAJOR , dev_list[i].minor),NULL ,"%s" , dev_list[i].name);
@@ -579,7 +579,7 @@ static int __init oss_init(void) dev_list[i].minor + (j*0x10)),S_IFCHR | dev_list[i].mode, "sound/%s%d", dev_list[i].name, j); -class_device_create (sound_class, +class_device_create (sound_class,NULL ,MKDEV (SOUND_MAJOR , dev_list[i].minor + (j*0x10 )),NULL ,"%s%d" , dev_list[i].name, j); }
sound/sound_core.c +1 -1
@@ -174,7 +174,7 @@ static int sound_insert_unit(struct soundevfs_mk_cdev (MKDEV (SOUND_MAJOR , s->unit_minor),S_IFCHR | mode, s->name); -class_device_create (sound_class,MKDEV (SOUND_MAJOR , s->unit_minor), +class_device_create (sound_class,NULL ,MKDEV (SOUND_MAJOR , s->unit_minor), dev, s->name+6 );return r;
PATCH 1/1 I2O: remove i2o_device_class
In reply to Greg KH[PATCH] I2O: remove i2o_device_class
I2O: cleanup - remove i2o_device_class
I2O devices reside on their own bus so there should be no reason to also have i2c_device class that mirros i2o bus.
---
commit b02f028de21efe6ba60d1896462a219f1356ea34
tree b1ea0338d95ff9cdf7861d58b3fb26d4d79cc4a3
parent 3d7eba1bed51352c3bd68b4e507c021ad7db928a
author Dmitry Torokhov <[email protected]> Thu, 29 Sep 2005 00:40:07 -0500 committer Greg Kroah-Hartman <[email protected]> Thu, 27 Oct 2005 22:48:00 -0700
drivers/message/i2o/core.h | 3 -- drivers/message/i2o/device.c | 71 ++++++++---------------------------------- drivers/message/i2o/driver.c | 3 ++ drivers/message/i2o/iop.c | 10 +----- include/linux/i2o.h | 2 - 5 files changed, 17 insertions(+), 72 deletions(-)
drivers/message/i2o/core.h +0 -3
@@ -36,9 +36,6 @@ extern void __exit i2o_pci_exit(void);extern void i2o_device_remove (struct i2o_device *);extern int i2o_device_parse_lct (struct i2o_controller *); -extern int i2o_device_init (void ); -extern void i2o_device_exit (void ); -/* IOP */ extern struct i2o_controller *i2o_iop_alloc (void );extern void i2o_iop_free (struct i2o_controller *);
drivers/message/i2o/device.c +13 -58
129 lines not on this page · raw message
drivers/message/i2o/driver.c +3 -0
@@ -58,9 +58,12 @@ static int i2o_bus_match(struct device * };/* I2O bus type */ +extern struct device_attribute i2o_device_attrs[]; +struct bus_type i2o_bus_type = { .name ="i2o" , .match = i2o_bus_match, + .dev_attrs = i2o_device_attrs, };/**
drivers/message/i2o/iop.c +1 -9
@@ -1243,14 +1243,10 @@ static int __init i2o_iop_init(void) printk(KERN_INFO OSM_DESCRIPTION " v" OSM_VERSION "\n"); - rc =i2o_device_init (); -if (rc) - goto exit; - i2o_controller_class =class_create (THIS_MODULE ,"i2o_controller" );if (IS_ERR (i2o_controller_class)) {osm_err ("can't register class i2o_controller\n" ); - goto device_exit; + goto exit; }if ((rc =i2o_driver_init ()))
@@ -1273,9 +1269,6 @@ static int __init i2o_iop_init(void) class_exit:class_destroy (i2o_controller_class); - device_exit: -i2o_device_exit (); - exit:return rc; }
@@ -1291,7 +1284,6 @@ static void __exit i2o_iop_exit(void)i2o_exec_exit ();i2o_driver_exit ();class_destroy (i2o_controller_class); -i2o_device_exit (); };module_init (i2o_iop_init);
include/linux/i2o.h +0 -2
@@ -66,8 +66,6 @@ struct i2o_device {struct device device;struct semaphore lock;/* device lock */ - -struct class_device classdev;/* i2o device class */ };/*
PATCH 1/1 add sysfs support for ide tape
In reply to Greg KH[PATCH] add sysfs support for ide tape
I was recently given an old Travan tape drive and asked to do something useful with it. The ide-scsi + st (+serverworks ide controller) combo results in a hard lockup of the machine which I have not had the energy to debug, so I turned to ide-tape (which seems to work). The system in question debian stable, using udev to manage /dev.
The following patch to ide-tape.c allows udev to create the cdev nodes for my drive.
---
commit e801e49d1ca90da1ab0286a3688f2465cb1e45e4
tree e7983a7c7dce4213431a1b951d3d803167ed41f9
parent 271c0df6e700b3f208b1802a1e96bb9eeeaa880c
author Will Dyson <[email protected]> Fri, 16 Sep 2005 02:55:07 -0700 committer Greg Kroah-Hartman <[email protected]> Thu, 27 Oct 2005 22:47:59 -0700
drivers/ide/ide-tape.c | 38 ++++++++++++++++++++++++++++++++++++-- 1 files changed, 36 insertions(+), 2 deletions(-)
drivers/ide/ide-tape.c +36 -2
@@ -1013,6 +1013,8 @@ typedef struct ide_tape_obj {static DECLARE_MUTEX (idetape_ref_sem); +static struct class *idetape_sysfs_class; +#define to_ide_tape (obj) container_of(obj, struct ide_tape_obj, kref)#define ide_tape_g (disk) \
@@ -4704,6 +4706,10 @@ static void ide_tape_release(struct kref drive->dsc_overlap =0 ; drive->driver_data =NULL ; +class_device_destroy (idetape_sysfs_class, +MKDEV (IDETAPE_MAJOR , tape->minor)); +class_device_destroy (idetape_sysfs_class, +MKDEV (IDETAPE_MAJOR , tape->minor +128 ));devfs_remove ("%s/mt" , drive->devfs_name);devfs_remove ("%s/mtn" , drive->devfs_name);devfs_unregister_tape (g->number);
@@ -4878,6 +4884,11 @@ static int ide_tape_probe(struct deviceidetape_setup (drive, tape, minor); +class_device_create (idetape_sysfs_class, +MKDEV (IDETAPE_MAJOR , minor), dev,"%s" , tape->name); +class_device_create (idetape_sysfs_class, +MKDEV (IDETAPE_MAJOR , minor +128 ), dev,"n%s" , tape->name); +devfs_mk_cdev (MKDEV (HWIF (drive)->major, minor),S_IFCHR |S_IRUGO |S_IWUGO ,"%s/mt" , drive->devfs_name);
@@ -4903,6 +4914,7 @@ MODULE_LICENSE("GPL"); static void __exit idetape_exit (void) {driver_unregister (&idetape_driver.gen_driver); +class_destroy (idetape_sysfs_class);unregister_chrdev (IDETAPE_MAJOR ,"ht" ); }
@@ -4911,11 +4923,33 @@ static void __exit idetape_exit (void)*/ static int idetape_init (void ) { +int error =1 ; + idetape_sysfs_class =class_create (THIS_MODULE ,"ide_tape" ); +if (IS_ERR (idetape_sysfs_class)) { + idetape_sysfs_class =NULL ; +printk (KERN_ERR "Unable to create sysfs class for ide tapes\n" ); + error = -EBUSY ; + goto out; + } +if (register_chrdev (IDETAPE_MAJOR ,"ht" , &idetape_fops)) {printk (KERN_ERR "ide-tape: Failed to register character device interface\n" ); -return -EBUSY ; + error = -EBUSY ; + goto out_free_class; } -return driver_register (&idetape_driver.gen_driver); + + error =driver_register (&idetape_driver.gen_driver); +if (error) + goto out_free_driver; + +return 0 ; + +out_free_driver: +driver_unregister (&idetape_driver.gen_driver); +out_free_class: +class_destroy (idetape_sysfs_class); +out: +return error; }module_init (idetape_init);
PATCH 1/1 Input: prepare to sysfs integration
In reply to Greg KH[PATCH] Input: prepare to sysfs integration
Input: prepare to sysfs integration
Add struct class_device to input_dev; add input_allocate_dev() to dynamically allocate input devices; dynamically allocated devices are automatically registered with sysfs.
---
commit 4086434e3a16b83e0cc651b5519f911dfa010cc7
tree a1b2f8d3605f58084c1272404d89cd723e240d8d
parent f2e28e004f12e0e3fd1edf3ca1f35b42ab45988f
author Dmitry Torokhov <[email protected]> Thu, 15 Sep 2005 02:01:39 -0500 committer Greg Kroah-Hartman <[email protected]> Thu, 27 Oct 2005 22:48:03 -0700
drivers/input/input.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++--- include/linux/input.h | 24 +++++++++++++++ 2 files changed, 95 insertions(+), 6 deletions(-)
drivers/input/input.c +72 -5
@@ -27,6 +27,7 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@sMODULE_DESCRIPTION ("Input core" );MODULE_LICENSE ("GPL" ); +EXPORT_SYMBOL (input_allocate_device);EXPORT_SYMBOL (input_register_device);EXPORT_SYMBOL (input_unregister_device);EXPORT_SYMBOL (input_register_handler);
@@ -605,6 +606,56 @@ static inline int input_proc_init(void)static inline void input_proc_exit (void ) { }#endif +static void input_dev_release (struct class_device *class_dev) +{ +struct input_dev *dev =to_input_dev (class_dev); + +kfree (dev); +module_put (THIS_MODULE ); +} + +static struct class input_dev_class = { + .name ="input_dev" , + .release = input_dev_release, +}; + +struct input_dev *input_allocate_device (void ) +{ +struct input_dev *dev; + + dev =kzalloc (sizeof (struct input_dev ),GFP_KERNEL ); +if (dev) { + dev->dynalloc =1 ; + dev->cdev.class = &input_dev_class; +class_device_initialize (&dev->cdev); +INIT_LIST_HEAD (&dev->h_list); +INIT_LIST_HEAD (&dev->node); + } + +return dev; +} + +static void input_register_classdevice (struct input_dev *dev) +{ +static atomic_t input_no =ATOMIC_INIT (0 ); +const char *path; + +__module_get (THIS_MODULE ); + + dev->dev = dev->cdev.dev; + +snprintf (dev->cdev.class_id,sizeof (dev->cdev.class_id), +"input%ld" , (unsigned long )atomic_inc_return (&input_no) -1 ); + + path =kobject_get_path (&dev->cdev.class->subsys.kset.kobj,GFP_KERNEL ); +printk (KERN_INFO "input: %s/%s as %s\n" , + dev->name ? dev->name :"Unspecified device" , + path ? path :"" , dev->cdev.class_id); +kfree (path); + +class_device_add (&dev->cdev); +} +void input_register_device (struct input_dev *dev) {struct input_handle *handle;
@@ -637,6 +688,10 @@ void input_register_device(struct input_if ((handle = handler->connect (handler, dev, id)))input_link_handle (handle); + +if (dev->dynalloc) +input_register_classdevice (dev); +#ifdef CONFIG_HOTPLUG input_call_hotplug ("add" , dev);#endif
@@ -665,6 +720,9 @@ void input_unregister_device(struct inpulist_del_init (&dev->node); +if (dev->dynalloc) +class_device_unregister (&dev->cdev); +input_wakeup_procfs_readers (); }
@@ -753,26 +811,34 @@ static int __init input_init(void) {int err; + err =class_register (&input_dev_class); +if (err) { +printk (KERN_ERR "input: unable to register input_dev class\n" ); +return err; + } + input_class =class_create (THIS_MODULE ,"input" );if (IS_ERR (input_class)) {printk (KERN_ERR "input: unable to register input class\n" ); -return PTR_ERR (input_class); + err =PTR_ERR (input_class); + goto fail1; } err =input_proc_init ();if (err) - goto fail1; + goto fail2; err =register_chrdev (INPUT_MAJOR ,"input" , &input_fops);if (err) {printk (KERN_ERR "input: unable to register char major %d" ,INPUT_MAJOR ); - goto fail2; + goto fail3; }return 0 ; - fail2:input_proc_exit (); - fail1:class_destroy (input_class); + fail3:input_proc_exit (); + fail2:class_destroy (input_class); + fail1:class_unregister (&input_dev_class);return err; }
@@ -781,6 +847,7 @@ static void __exit input_exit(void)input_proc_exit ();unregister_chrdev (INPUT_MAJOR ,"input" );class_destroy (input_class); +class_unregister (&input_dev_class); }subsys_initcall (input_init);
include/linux/input.h +23 -1
@@ -12,6 +12,7 @@#ifdef __KERNEL__#include <linux/time.h> #include <linux/list.h> +#include <linux/device.h> #else #include <sys/time.h> #include <sys/ioctl.h>
@@ -889,11 +890,15 @@ struct input_dev {struct semaphore sem;/* serializes open and close operations */ unsigned int users; -struct device *dev; +struct class_device cdev; +struct device *dev;/* will be removed soon */ + +int dynalloc;/* temporarily */ struct list_head h_list;struct list_head node; }; +#define to_input_dev (d) container_of(d, struct input_dev, cdev)/* * Structure for hotplug & device<->driver matching.
@@ -984,6 +989,23 @@ static inline void init_input_dev(structINIT_LIST_HEAD (&dev->node); } +struct input_dev *input_allocate_device (void ); + +static inline void input_free_device (struct input_dev *dev) +{ +kfree (dev); +} + +static inline struct input_dev *input_get_device (struct input_dev *dev) +{ +return to_input_dev (class_device_get (&dev->cdev)); +} + +static inline void input_put_device (struct input_dev *dev) +{ +class_device_put (&dev->cdev); +} +void input_register_device (struct input_dev *);void input_unregister_device (struct input_dev *);
PATCH 1/1 I2O: remove class interface
In reply to Greg KH[PATCH] I2O: remove class interface
I2O: remove i2o_device_class_interface misuse
The intent of class interfaces was to provide different 'views' at the same object, not just run some code every time a new class device is registered. Kill interface structure, make class core register default attributes and set up sysfs links right when registering class devices.
---
commit e12574538ea88cd5e15d7135e9ae6e267d314f2c
tree 301ed903a0a558c231c69b6390db67f7a169c184
parent 85a44726f49989a2647cd850d55ec5be75727c5b
author Dmitry Torokhov <[email protected]> Thu, 15 Sep 2005 02:01:32 -0500 committer Greg Kroah-Hartman <[email protected]> Thu, 27 Oct 2005 22:48:00 -0700
drivers/message/i2o/device.c | 255 ++++++++++++++++++++---------------------- 1 files changed, 122 insertions(+), 133 deletions(-)
drivers/message/i2o/device.c +122 -133
@@ -45,10 +45,10 @@ static inline int i2o_device_issue_claimwritel (type, &msg->body[0 ]);return i2o_msg_post_wait (dev->iop, m,60 ); -}; +}/** -* i2o_device_claim - claim a device for use by an OSM +* i2o_device_claim - claim a device for use by an OSM * @dev: I2O device to claim * @drv: I2O driver which wants to claim the device *
@@ -73,7 +73,7 @@ int i2o_device_claim(struct i2o_device *up (&dev->lock);return rc; -}; +}/** * i2o_device_claim_release - release a device that the OSM is using
@@ -119,7 +119,8 @@ int i2o_device_claim_release(struct i2o_up (&dev->lock);return rc; -}; +} +/** * i2o_device_release - release the memory for a I2O device
@@ -135,39 +136,62 @@ static void i2o_device_release(struct depr_debug ("i2o: device %s released\n" , dev->bus_id);kfree (i2o_dev); -}; +}/** -* i2o_device_class_release - Remove I2O device attributes +* i2o_device_class_release - I2O class device release function * @cd: I2O class device which is added to the I2O device class * -* Removes attributes from the I2O device again. Also search each device -* on the controller for I2O devices which refert to this device as parent -* or user and remove this links also. +* The function is just a stub - memory will be freed when +* associated I2O device is released. */ static void i2o_device_class_release (struct class_device *cd) { -struct i2o_device *i2o_dev, *tmp; -struct i2o_controller *c; +/* empty */ +} - i2o_dev =to_i2o_device (cd->dev); - c = i2o_dev->iop; +/** +* i2o_device_class_show_class_id - Displays class id of I2O device +* @cd: class device of which the class id should be displayed +* @buf: buffer into which the class id should be printed +* +* Returns the number of bytes which are printed into the buffer. +*/ +static ssize_t i2o_device_class_show_class_id (struct class_device *cd, +char *buf) +{ +struct i2o_device *dev =to_i2o_device (cd->dev); -sysfs_remove_link (&i2o_dev->device.kobj,"parent" ); -sysfs_remove_link (&i2o_dev->device.kobj,"user" ); +sprintf (buf,"0x%03x\n" , dev->lct_data.class_id); +return strlen (buf) +1 ; +} -list_for_each_entry (tmp, &c->devices, list) { -if (tmp->lct_data.parent_tid == i2o_dev->lct_data.tid) -sysfs_remove_link (&tmp->device.kobj,"parent" ); -if (tmp->lct_data.user_tid == i2o_dev->lct_data.tid) -sysfs_remove_link (&tmp->device.kobj,"user" ); - } +/** +* i2o_device_class_show_tid - Displays TID of I2O device +* @cd: class device of which the TID should be displayed +* @buf: buffer into which the class id should be printed +* +* Returns the number of bytes which are printed into the buffer. +*/ +static ssize_t i2o_device_class_show_tid (struct class_device *cd,char *buf) +{ +struct i2o_device *dev =to_i2o_device (cd->dev); + +sprintf (buf,"0x%03x\n" , dev->lct_data.tid); +return strlen (buf) +1 ; +} + +static struct class_device_attribute i2o_device_class_attrs[] = { +__ATTR (class_id,S_IRUGO , i2o_device_class_show_class_id,NULL ), +__ATTR (tid,S_IRUGO , i2o_device_class_show_tid,NULL ), + __ATTR_NULL };/* I2O device class */ static struct class i2o_device_class = { - .name ="i2o_device" , - .release = i2o_device_class_release + .name ="i2o_device" , + .release = i2o_device_class_release, + .class_dev_attrs = i2o_device_class_attrs, };/**
@@ -197,7 +221,67 @@ static struct i2o_device *i2o_device_all dev->classdev.dev = &dev->device;return dev; -}; +} + +/** +* i2o_setup_sysfs_links - Adds attributes to the I2O device +* @cd: I2O class device which is added to the I2O device class +* +* This function get called when a I2O device is added to the class. It +* creates the attributes for each device and creates user/parent symlink +* if necessary. +* +* Returns 0 on success or negative error code on failure. +*/ +static void i2o_setup_sysfs_links (struct i2o_device *i2o_dev) +{ +struct i2o_controller *c = i2o_dev->iop; +struct i2o_device *tmp; + +/* create user entries for this device */ + tmp =i2o_iop_find_device (i2o_dev->iop, i2o_dev->lct_data.user_tid); +if (tmp && tmp != i2o_dev) +sysfs_create_link (&i2o_dev->device.kobj, + &tmp->device.kobj,"user" ); + +/* create user entries refering to this device */ +list_for_each_entry (tmp, &c->devices, list) +if (tmp->lct_data.user_tid == i2o_dev->lct_data.tid && + tmp != i2o_dev) +sysfs_create_link (&tmp->device.kobj, + &i2o_dev->device.kobj,"user" ); + +/* create parent entries for this device */ + tmp =i2o_iop_find_device (i2o_dev->iop, i2o_dev->lct_data.parent_tid); +if (tmp && tmp != i2o_dev) +sysfs_create_link (&i2o_dev->device.kobj, + &tmp->device.kobj,"parent" ); + +/* create parent entries refering to this device */ +list_for_each_entry (tmp, &c->devices, list) +if (tmp->lct_data.parent_tid == i2o_dev->lct_data.tid && + tmp != i2o_dev) +sysfs_create_link (&tmp->device.kobj, + &i2o_dev->device.kobj,"parent" ); +} + +static void i2o_remove_sysfs_links (struct i2o_device *i2o_dev) +{ +struct i2o_controller *c = i2o_dev->iop; +struct i2o_device *tmp; + +sysfs_remove_link (&i2o_dev->device.kobj,"parent" ); +sysfs_remove_link (&i2o_dev->device.kobj,"user" ); + +list_for_each_entry (tmp, &c->devices, list) { +if (tmp->lct_data.parent_tid == i2o_dev->lct_data.tid) +sysfs_remove_link (&tmp->device.kobj,"parent" ); +if (tmp->lct_data.user_tid == i2o_dev->lct_data.tid) +sysfs_remove_link (&tmp->device.kobj,"user" ); + } +} + +/** * i2o_device_add - allocate a new I2O device and add it to the IOP
@@ -222,6 +306,7 @@ static struct i2o_device *i2o_device_add } dev->lct_data = *entry; + dev->iop = c;snprintf (dev->device.bus_id,BUS_ID_SIZE ,"%d:%03x" , c->unit, dev->lct_data.tid);
@@ -229,7 +314,6 @@ static struct i2o_device *i2o_device_addsnprintf (dev->classdev.class_id,BUS_ID_SIZE ,"%d:%03x" , c->unit, dev->lct_data.tid); - dev->iop = c; dev->device.parent = &c->device;device_register (&dev->device);
@@ -238,12 +322,14 @@ static struct i2o_device *i2o_device_addclass_device_register (&dev->classdev); +i2o_setup_sysfs_links (dev); +i2o_driver_notify_device_add_all (dev);pr_debug ("i2o: device %s added\n" , dev->device.bus_id);return dev; -}; +}/** * i2o_device_remove - remove an I2O device from the I2O core
@@ -256,10 +342,11 @@ static struct i2o_device *i2o_device_addvoid i2o_device_remove (struct i2o_device *i2o_dev) {i2o_driver_notify_device_remove_all (i2o_dev); +i2o_remove_sysfs_links (i2o_dev);class_device_unregister (&i2o_dev->classdev);list_del (&i2o_dev->list);device_unregister (&i2o_dev->device); -}; +}/** * i2o_device_parse_lct - Parse a previously fetched LCT and create devices
@@ -337,99 +424,8 @@ int i2o_device_parse_lct(struct i2o_contup (&c->lct_lock);return 0 ; -}; - -/** -* i2o_device_class_show_class_id - Displays class id of I2O device -* @cd: class device of which the class id should be displayed -* @buf: buffer into which the class id should be printed -* -* Returns the number of bytes which are printed into the buffer. -*/ -static ssize_t i2o_device_class_show_class_id (struct class_device *cd, -char *buf) -{ -struct i2o_device *dev =to_i2o_device (cd->dev); - -sprintf (buf,"0x%03x\n" , dev->lct_data.class_id); -return strlen (buf) +1 ; -}; - -/** -* i2o_device_class_show_tid - Displays TID of I2O device -* @cd: class device of which the TID should be displayed -* @buf: buffer into which the class id should be printed -* -* Returns the number of bytes which are printed into the buffer. -*/ -static ssize_t i2o_device_class_show_tid (struct class_device *cd,char *buf) -{ -struct i2o_device *dev =to_i2o_device (cd->dev); - -sprintf (buf,"0x%03x\n" , dev->lct_data.tid); -return strlen (buf) +1 ; -}; - -/* I2O device class attributes */ -static CLASS_DEVICE_ATTR(class_id, S_IRUGO, i2o_device_class_show_class_id, - NULL); -static CLASS_DEVICE_ATTR(tid, S_IRUGO, i2o_device_class_show_tid, NULL); - -/** -* i2o_device_class_add - Adds attributes to the I2O device -* @cd: I2O class device which is added to the I2O device class -* -* This function get called when a I2O device is added to the class. It -* creates the attributes for each device and creates user/parent symlink -* if necessary. -* -* Returns 0 on success or negative error code on failure. -*/ -static int i2o_device_class_add (struct class_device *cd) -{ -struct i2o_device *i2o_dev, *tmp; -struct i2o_controller *c; - - i2o_dev =to_i2o_device (cd->dev); - c = i2o_dev->iop; - -class_device_create_file (cd, &class_device_attr_class_id); -class_device_create_file (cd, &class_device_attr_tid); - -/* create user entries for this device */ - tmp =i2o_iop_find_device (i2o_dev->iop, i2o_dev->lct_data.user_tid); -if (tmp && (tmp != i2o_dev)) -sysfs_create_link (&i2o_dev->device.kobj, &tmp->device.kobj, -"user" ); - -/* create user entries refering to this device */ -list_for_each_entry (tmp, &c->devices, list) -if ((tmp->lct_data.user_tid == i2o_dev->lct_data.tid) - && (tmp != i2o_dev)) -sysfs_create_link (&tmp->device.kobj, - &i2o_dev->device.kobj,"user" ); - -/* create parent entries for this device */ - tmp =i2o_iop_find_device (i2o_dev->iop, i2o_dev->lct_data.parent_tid); -if (tmp && (tmp != i2o_dev)) -sysfs_create_link (&i2o_dev->device.kobj, &tmp->device.kobj, -"parent" ); - -/* create parent entries refering to this device */ -list_for_each_entry (tmp, &c->devices, list) -if ((tmp->lct_data.parent_tid == i2o_dev->lct_data.tid) - && (tmp != i2o_dev)) -sysfs_create_link (&tmp->device.kobj, - &i2o_dev->device.kobj,"parent" ); - -return 0 ; -}; +} -/* I2O device class interface */ -static struct class_interface i2o_device_class_interface = { - .class = &i2o_device_class, - .add = i2o_device_class_add -};/* * Run time support routines
@@ -553,11 +549,11 @@ int i2o_parm_field_get(struct i2o_device }/* -* if oper == I2O_PARAMS_TABLE_GET, get from all rows -* if fieldcount == -1 return all fields +* if oper == I2O_PARAMS_TABLE_GET, get from all rows +* if fieldcount == -1 return all fields * ibuf and ibuflen are unused (use NULL, 0) -* else return specific fields -* ibuf contains fieldindexes +* else return specific fields +* ibuf contains fieldindexes * * if oper == I2O_PARAMS_LIST_GET, get from specific rows * if fieldcount == -1 return all fields
@@ -611,14 +607,8 @@ int i2o_parm_table_get(struct i2o_device*/ int i2o_device_init (void ) { -int rc; - - rc =class_register (&i2o_device_class); -if (rc) -return rc; - -return class_interface_register (&i2o_device_class_interface); -}; +return class_register (&i2o_device_class); +}/** * i2o_device_exit - I2O devices exit function
@@ -627,9 +617,8 @@ int i2o_device_init(void)*/ void i2o_device_exit (void ) { -class_interface_register (&i2o_device_class_interface);class_unregister (&i2o_device_class); -}; +}EXPORT_SYMBOL (i2o_device_claim);EXPORT_SYMBOL (i2o_device_claim_release);
PATCH 1/1 aoe: use get_unaligned for accesses in ATA id buffer
In reply to Greg KH[PATCH] aoe: use get_unaligned for accesses in ATA id buffer
Use get_unaligned for possibly-unaligned multi-byte accesses to the ATA device identify response buffer.
---
commit 786fbf6c1eb91e7e70a1ef42ff2523aff0f09850
tree 2a2d7be04f20f9c3a2d133eaa37d33797d7e27da
parent 741b2252a5e14d6c60a913c77a6099abe73a854a
author Ed L. Cashin <[email protected]> Thu, 29 Sep 2005 12:47:40 -0400 committer Greg Kroah-Hartman <[email protected]> Thu, 27 Oct 2005 22:47:58 -0700
drivers/block/aoe/aoecmd.c | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-)
drivers/block/aoe/aoecmd.c +8 -7
@@ -8,6 +8,7 @@#include <linux/blkdev.h> #include <linux/skbuff.h> #include <linux/netdevice.h> +#include <asm/unaligned.h> #include "aoe.h" #define TIMERTICK (HZ / 10)
@@ -311,16 +312,16 @@ ataid_complete(struct aoedev *d, unsigneu16 n;/* word 83: command set supported */ - n =le16_to_cpup ((__le16 *) &id[83 <<1 ]); + n =le16_to_cpu (get_unaligned ((__le16 *) &id[83 <<1 ]));/* word 86: command set/feature enabled */ - n |=le16_to_cpup ((__le16 *) &id[86 <<1 ]); + n |=le16_to_cpu (get_unaligned ((__le16 *) &id[86 <<1 ]));if (n & (1 <<10 )) {/* bit 10: LBA 48 */ d->flags |=DEVFL_EXT ;/* word 100: number lba48 sectors */ - ssize =le64_to_cpup ((__le64 *) &id[100 <<1 ]); + ssize =le64_to_cpu (get_unaligned ((__le64 *) &id[100 <<1 ]));/* set as in ide-disk.c:init_idedisk_capacity */ d->geo.cylinders = ssize;
@@ -331,12 +332,12 @@ ataid_complete(struct aoedev *d, unsigne d->flags &= ~DEVFL_EXT ;/* number lba28 sectors */ - ssize =le32_to_cpup ((__le32 *) &id[60 <<1 ]); + ssize =le32_to_cpu (get_unaligned ((__le32 *) &id[60 <<1 ]));/* NOTE: obsolete in ATA 6 */ - d->geo.cylinders =le16_to_cpup ((__le16 *) &id[54 <<1 ]); - d->geo.heads =le16_to_cpup ((__le16 *) &id[55 <<1 ]); - d->geo.sectors =le16_to_cpup ((__le16 *) &id[56 <<1 ]); + d->geo.cylinders =le16_to_cpu (get_unaligned ((__le16 *) &id[54 <<1 ])); + d->geo.heads =le16_to_cpu (get_unaligned ((__le16 *) &id[55 <<1 ])); + d->geo.sectors =le16_to_cpu (get_unaligned ((__le16 *) &id[56 <<1 ])); } d->ssize = ssize; d->geo.start =0 ;
Re: [PATCH] Driver Core: document struct class_device properly
In reply to Greg KHQuoted 1 line · Greg KH
[PATCH] Driver Core: document struct
class_deviceproperly
...
Quoted 8 lines
+ * @release: pointer to a release function for this struct
class_device. If
+ * set, this will be called instead of the class specific release function.
+ * Only use this if you want to override the default release function, like
+ * when you are nestingclass_devicestructures.
+ * @hotplug: pointer to a hotplug function for this structclass_device. If
+ * set, this will be called instead of the class specific hotplug function.
+ * Only use this if you want to override the default hotplug function, like
+ * when you are nestingclass_devicestructures.
Greg,
Is this solution for nesting class devices considered permanent or is it a stop-gap measure? I hope it is latter as these 2 new methods allow one class device walk all over class's intended interface and semantics and you can no longer rely that objects of the same class have similar characteristics/attributes and similar behavior. You already had to abandon using class's default attributes when dealing with nested devices, I think it is wrong long-term solution.
What about Kay's proposal about moving (as far as userspace concerned) everything into /sys/devices?
Signature · 1 line
Dmitry
Re: [PATCH] drivers/input/keyboard: convert to dynamic input_dev allocation
In reply to Greg KHQuoted 11 lines · Greg KH
drivers/input/keyboard/lkkbd.c +1
-2@@ -435,14 +434,14 @@ lkkbd_interrupt (struct serio *serio, unswitch (data) {case LK_ALL_KEYS_UP : -input_regs (&lk->dev, regs); +input_regs (lk->dev, regs);for (i =0 ; i <ARRAY_SIZE (lkkbd_keycode); i++)if (lk->keycode[i] !=KEY_RESERVED ) -input_report_key (&lk->dev, lk->keycode[i],0 );
drivers/input/keyboard/lkkbd.c lkkbd_interrupt (struct serio *serio, un · line 447
Quoted 10 lines
drivers/input/keyboard/lkkbd.c +3
-2-input_sync (&lk->dev); +input_report_key (lk->dev, lk->keycode[i],0 ); +input_sync (lk->dev);break ;case LK_METRONOME : -DBG (KERN_INFO "Got LK_METRONOME and don't " +DBG (KERN_INFO "Got %#d and don't " "know how to handle...\n" );break ;case LK_OUTPUT_ERROR :
The format change (%#d) should take an argument on stack, shouldn't it? But there's nothing pushed? ...or is it just a typo?
MfG, JBG
Signature · 4 lines
Jan-Benedict Glaw [email protected] . +49-172-7608481 _ O _ "Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg _ _ O für einen Freien Staat voll Freier Bürger" | im Internet! | im Irak! O O O ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
Re: [PATCH] drivers/input/keyboard: convert to dynamic input_dev allocation
Quoted 17 lines · Jan-Benedict Glaw
Quoted 16 lines · Greg KH
drivers/input/keyboard/lkkbd.c +3
-3@@ -435,14 +434,14 @@ lkkbd_interrupt (struct serio *serio, unswitch (data) {case LK_ALL_KEYS_UP : -input_regs (&lk->dev, regs); +input_regs (lk->dev, regs);for (i =0 ; i <ARRAY_SIZE (lkkbd_keycode); i++)if (lk->keycode[i] !=KEY_RESERVED ) -input_report_key (&lk->dev, lk->keycode[i],0 ); -input_sync (&lk->dev); +input_report_key (lk->dev, lk->keycode[i],0 ); +input_sync (lk->dev);break ;case LK_METRONOME :
Quoted 9 lines
drivers/input/keyboard/lkkbd.c lkkbd_interrupt (struct serio *serio, un · line 447
Quoted 5 lines
drivers/input/keyboard/lkkbd.c +1
-1-DBG (KERN_INFO "Got LK_METRONOME and don't " +DBG (KERN_INFO "Got %#d and don't " "know how to handle...\n" );break ;case LK_OUTPUT_ERROR :The format change (%#d) should take an argument on stack, shouldn't it? But there's nothing pushed? ...or is it just a typo?
I think I messed it up... Was probably trying to do "default" case and then reverted back. Will fix.
Signature · 1 line
Dmitry
Al Viro
NAKRe: [PATCH] kobject: fix gfp flags type
In reply to Greg KHQuoted 9 lines · Greg KH
[PATCH] kobject: fix gfp flags type
Fix implicit nocast warnings in
kobject_ueventcode, including__nocast:lib/kobject_uevent.c:78:37: warning: implicit cast to nocast typelib/kobject_uevent.c:97:51: warning: implicit cast to nocast typelib/kobject_uevent.c:120:27: warning: implicit cast to nocast typeSigned-off-by Randy Dunlap <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
NAK - explicit use of __nocast is wrong here.
Re: [PATCH] pci device wakeup flags
In reply to Greg KHQuoted 11 lines · Greg KH
[PATCH] pci device wakeup flags
This patch teaches "
pci_dev" about the new driver model wakeup support:- It marks devices as supporting wakeup when "can issue PME#" is listed in its PCI PM capability.
-
pci_enable_wake()refuses to enable wake if that's been disabled (e.g. through sysfs).
Quoted 8 lines
NOTE that a recent patch changed PCI probing, and this reverts part of that change ... so that driver model initialization is again done before the PCI setup.
(One issue is that the driver model "init + add == register" pattern isn't being used inside PCI ... and that probe change worsened the problem by making "add" do some "init" too. Maybe PCI should match the driver model more closely, and just grow a new "
pci_dev_init" function.)
This is the patch which I've been religiously dropping from -mm because it kills my Mac G5. What are we doing merging this?
Re: [PATCH] pci device wakeup flags
Quoted 3 lines · Andrew Morton
This is the patch which I've been religiously dropping from -mm because it kills my Mac G5. What are we doing merging this?
Well, since my main machine is a Mac G5, we certainly /aren't/ merging it if it kills it.
Linus
Re: [PATCH] pci device wakeup flags
In reply to Andrew MortonQuoted 16 lines · Andrew Morton
Quoted 15 lines · Greg KH
[PATCH] pci device wakeup flags
This patch teaches "
pci_dev" about the new driver model wakeup support:- It marks devices as supporting wakeup when "can issue PME#" is listed in its PCI PM capability.
-
pci_enable_wake()refuses to enable wake if that's been disabled (e.g. through sysfs).NOTE that a recent patch changed PCI probing, and this reverts part of that change ... so that driver model initialization is again done before the PCI setup.
Quoted 7 lines
Quoted 4 lines
(One issue is that the driver model "init + add == register" pattern isn't being used inside PCI ... and that probe change worsened the problem by making "add" do some "init" too. Maybe PCI should match the driver model more closely, and just grow a new "
pci_dev_init" function.)This is the patch which I've been religiously dropping from -mm because it kills my Mac G5. What are we doing merging this?
Crap, sorry about that. I've deleted my tree and will rebuild it. I thought that it was one of the usb patches in my tree that was causing you problems. I'll not include this one until we get to the bottom of it (and with David gone, that might take a while.)
Again, very sorry about this.
Oh, and I'll also drop the one from Randy with the gfp flags, and properly attribute Russell's patch.
thanks,
greg k-h
Quoted 3 lines · Greg KH
Here are a lot of driver core patches for 2.6.14. They have all been in the past few -mm releases with no problems. They contain the following things:
Ok, I've fixed up the issues people had with this tree. I've removed the offending pci patch, the gfp_flag patch, added a documentation patch, and (hopefully) proper attributed Russell's patch. I've also merged against your latest tree.
Please pull from:
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6.git/
or if master.kernel.org hasn't synced up yet:
master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6.git/
Below is the diffstat and shortlog of the changes.
thanks,
greg k-h
Documentation/Changes | 2 Documentation/DocBook/writing_usb_driver.tmpl | 3 Documentation/driver-model/driver.txt | 68 --- Documentation/driver-model/porting.txt | 2 arch/arm/common/locomo.c | 10 arch/arm/common/sa1111.c | 11 arch/arm/common/scoop.c | 24 - arch/arm/mach-pxa/corgi_ssp.c | 24 - arch/arm/mach-sa1100/neponset.c | 28 - arch/i386/kernel/cpuid.c | 2 arch/i386/kernel/msr.c | 2 drivers/base/attribute_container.c | 2 drivers/base/base.h | 12 drivers/base/class.c | 152 ++++-- drivers/base/core.c | 21 drivers/base/cpu.c | 1 drivers/base/driver.c | 3 drivers/base/firmware.c | 3 drivers/base/init.c | 10 drivers/base/platform.c | 22 drivers/base/power/sysfs.c | 73 +++ drivers/block/aoe/aoe.h | 2 drivers/block/aoe/aoechr.c | 2 drivers/block/aoe/aoecmd.c | 15 drivers/block/genhd.c | 25 + drivers/block/paride/pg.c | 2 drivers/block/paride/pt.c | 4 drivers/char/dsp56k.c | 2 drivers/char/ftape/zftape/zftape-init.c | 12 drivers/char/ip2main.c | 10 drivers/char/ipmi/ipmi_devintf.c | 2 drivers/char/istallion.c | 3 drivers/char/lp.c | 2 drivers/char/mem.c | 3 drivers/char/misc.c | 2 drivers/char/ppdev.c | 2 drivers/char/raw.c | 4 drivers/char/s3c2410-rtc.c | 20 drivers/char/snsc.c | 2 drivers/char/sonypi.c | 106 ++-- drivers/char/stallion.c | 4 drivers/char/tipar.c | 2 drivers/char/tty_io.c | 10 drivers/char/vc_screen.c | 10 drivers/char/viotape.c | 4 drivers/char/watchdog/s3c2410_wdt.c | 34 - drivers/hwmon/hdaps.c | 6 drivers/hwmon/hwmon.c | 2 drivers/i2c/busses/i2c-s3c2410.c | 8 drivers/i2c/i2c-core.c | 4 drivers/ide/ide-tape.c | 42 + drivers/ieee1394/dv1394.c | 2 drivers/ieee1394/nodemgr.c | 4 drivers/ieee1394/raw1394.c | 2 drivers/ieee1394/video1394.c | 2 drivers/infiniband/core/ucm.c | 2 drivers/input/evdev.c | 26 - drivers/input/input.c | 555 +++++++++++++++---------- drivers/input/joydev.c | 26 - drivers/input/joystick/adi.c | 93 ++-- drivers/input/joystick/amijoy.c | 87 ++- drivers/input/joystick/analog.c | 100 ++-- drivers/input/joystick/cobra.c | 70 +-- drivers/input/joystick/db9.c | 292 +++++++------ drivers/input/joystick/gamecon.c | 396 +++++++++-------- drivers/input/joystick/gf2k.c | 71 +-- drivers/input/joystick/grip.c | 85 ++- drivers/input/joystick/grip_mp.c | 149 +++--- drivers/input/joystick/guillemot.c | 53 +- drivers/input/joystick/iforce/iforce-main.c | 106 ++-- drivers/input/joystick/iforce/iforce-packets.c | 5 drivers/input/joystick/iforce/iforce-serio.c | 10 drivers/input/joystick/iforce/iforce-usb.c | 22 drivers/input/joystick/iforce/iforce.h | 2 drivers/input/joystick/interact.c | 55 +- drivers/input/joystick/magellan.c | 71 +-- drivers/input/joystick/sidewinder.c | 72 +-- drivers/input/joystick/spaceball.c | 82 +-- drivers/input/joystick/spaceorb.c | 78 +-- drivers/input/joystick/stinger.c | 75 +-- drivers/input/joystick/tmdc.c | 324 ++++++++------ drivers/input/joystick/turbografx.c | 223 ++++++---- drivers/input/joystick/twidjoy.c | 118 ++--- drivers/input/joystick/warrior.c | 83 +-- drivers/input/keyboard/amikbd.c | 59 +- drivers/input/keyboard/atkbd.c | 188 ++++---- drivers/input/keyboard/corgikbd.c | 96 ++-- drivers/input/keyboard/lkkbd.c | 126 ++--- drivers/input/keyboard/maple_keyb.c | 76 +-- drivers/input/keyboard/newtonkbd.c | 83 +-- drivers/input/keyboard/spitzkbd.c | 121 ++--- drivers/input/keyboard/sunkbd.c | 117 ++--- drivers/input/keyboard/xtkbd.c | 82 +-- drivers/input/misc/m68kspkr.c | 40 - drivers/input/misc/pcspkr.c | 34 - drivers/input/misc/sparcspkr.c | 45 -- drivers/input/mouse/alps.c | 67 +-- drivers/input/mouse/alps.h | 2 drivers/input/mouse/amimouse.c | 51 +- drivers/input/mouse/inport.c | 96 ++-- drivers/input/mouse/lifebook.c | 16 drivers/input/mouse/logibm.c | 88 ++- drivers/input/mouse/logips2pp.c | 20 drivers/input/mouse/maplemouse.c | 10 drivers/input/mouse/pc110pad.c | 70 +-- drivers/input/mouse/psmouse-base.c | 99 ++-- drivers/input/mouse/psmouse.h | 2 drivers/input/mouse/rpcmouse.c | 43 - drivers/input/mouse/sermouse.c | 84 +-- drivers/input/mouse/synaptics.c | 6 drivers/input/mouse/vsxxxaa.c | 84 +-- drivers/input/mousedev.c | 41 - drivers/input/serio/i8042.c | 13 drivers/input/touchscreen/corgi_ts.c | 131 ++--- drivers/input/touchscreen/elo.c | 89 +--- drivers/input/touchscreen/gunze.c | 66 +- drivers/input/touchscreen/h3600_ts_input.c | 149 ++---- drivers/input/touchscreen/hp680_ts_input.c | 58 +- drivers/input/touchscreen/mk712.c | 80 +-- drivers/input/touchscreen/mtouch.c | 64 +- drivers/input/tsdev.c | 29 - drivers/isdn/capi/capi.c | 2 drivers/macintosh/adb.c | 2 drivers/macintosh/adbhid.c | 220 +++++---- drivers/macintosh/mac_hid.c | 44 + drivers/media/common/ir-common.c | 1 drivers/media/dvb/cinergyT2/cinergyT2.c | 108 +++- drivers/media/dvb/dvb-core/dvbdev.c | 2 drivers/media/dvb/dvb-usb/dvb-usb-remote.c | 50 +- drivers/media/dvb/dvb-usb/dvb-usb.h | 3 drivers/media/dvb/ttpci/av7110_ir.c | 37 - drivers/media/dvb/ttpci/budget-ci.c | 24 - drivers/media/dvb/ttusb-dec/ttusb_dec.c | 51 +- drivers/media/video/bttvp.h | 2 drivers/media/video/cx88/cx88-input.c | 58 +- drivers/media/video/ir-kbd-gpio.c | 52 +- drivers/media/video/ir-kbd-i2c.c | 33 - drivers/media/video/msp3400.c | 8 drivers/media/video/saa7134/saa7134-input.c | 39 - drivers/media/video/saa7134/saa7134.h | 2 drivers/media/video/tda9887.c | 4 drivers/media/video/tuner-core.c | 4 drivers/message/i2o/core.h | 3 drivers/message/i2o/device.c | 326 ++++++-------- drivers/message/i2o/driver.c | 3 drivers/message/i2o/iop.c | 34 - drivers/mfd/mcp-sa11x0.c | 20 drivers/mfd/ucb1x00-ts.c | 45 +- drivers/mmc/pxamci.c | 8 drivers/mmc/wbsd.c | 4 drivers/mtd/maps/sa1100-flash.c | 8 drivers/mtd/mtdchar.c | 4 drivers/net/dm9000.c | 8 drivers/net/irda/sa1100_ir.c | 8 drivers/net/irda/smsc-ircc2.c | 12 drivers/net/phy/mdio_bus.c | 20 drivers/net/ppp_generic.c | 2 drivers/net/smc91x.c | 8 drivers/net/wan/cosa.c | 2 drivers/pci/pcie/portdrv_core.c | 4 drivers/pcmcia/au1000_generic.c | 21 drivers/pcmcia/ds.c | 6 drivers/pcmcia/hd64465_ss.c | 20 drivers/pcmcia/i82365.c | 20 drivers/pcmcia/m32r_cfc.c | 21 drivers/pcmcia/m32r_pcc.c | 21 drivers/pcmcia/omap_cf.c | 18 drivers/pcmcia/pxa2xx_base.c | 26 - drivers/pcmcia/rsrc_nonstatic.c | 6 drivers/pcmcia/sa1100_generic.c | 20 drivers/pcmcia/socket_sysfs.c | 6 drivers/pcmcia/tcic.c | 20 drivers/pcmcia/vrc4171_card.c | 24 - drivers/s390/char/tape_class.c | 1 drivers/s390/char/vmlogrdr.c | 1 drivers/scsi/ch.c | 2 drivers/scsi/osst.c | 2 drivers/scsi/sg.c | 10 drivers/scsi/st.c | 2 drivers/serial/8250.c | 10 drivers/serial/imx.c | 8 drivers/serial/mpc52xx_uart.c | 8 drivers/serial/pxa.c | 8 drivers/serial/s3c2410.c | 9 drivers/serial/sa1100.c | 8 drivers/serial/vr41xx_siu.c | 10 drivers/usb/core/devio.c | 2 drivers/usb/core/file.c | 4 drivers/usb/core/hcd.c | 3 drivers/usb/core/hub.c | 16 drivers/usb/gadget/dummy_hcd.c | 22 drivers/usb/gadget/omap_udc.c | 9 drivers/usb/gadget/pxa2xx_udc.c | 17 drivers/usb/host/isp116x-hcd.c | 14 drivers/usb/host/ohci-omap.c | 10 drivers/usb/host/ohci-pxa27x.c | 4 drivers/usb/host/sl811-hcd.c | 10 drivers/usb/input/acecad.c | 78 +-- drivers/usb/input/aiptek.c | 209 ++++----- drivers/usb/input/appletouch.c | 130 +++-- drivers/usb/input/ati_remote.c | 173 ++++--- drivers/usb/input/hid-core.c | 51 +- drivers/usb/input/hid-input.c | 58 +- drivers/usb/input/hid-lgff.c | 17 drivers/usb/input/hid-tmff.c | 11 drivers/usb/input/hid.h | 2 drivers/usb/input/itmtouch.c | 72 +-- drivers/usb/input/kbtab.c | 86 +-- drivers/usb/input/keyspan_remote.c | 214 ++++----- drivers/usb/input/mtouchusb.c | 111 ++--- drivers/usb/input/pid.c | 12 drivers/usb/input/powermate.c | 136 +++--- drivers/usb/input/touchkitusb.c | 116 ++--- drivers/usb/input/usbkbd.c | 105 ++-- drivers/usb/input/usbmouse.c | 97 ++-- drivers/usb/input/wacom.c | 142 ++---- drivers/usb/input/xpad.c | 97 +--- drivers/usb/input/yealink.c | 66 +- drivers/usb/media/konicawc.c | 89 ++-- drivers/usb/storage/onetouch.c | 105 ++-- drivers/video/backlight/corgi_bl.c | 10 drivers/video/fbmem.c | 2 drivers/video/imxfb.c | 10 drivers/video/pxafb.c | 10 drivers/video/s1d13xxxfb.c | 7 drivers/video/s3c2410fb.c | 29 - drivers/video/sa1100fb.c | 10 drivers/video/w100fb.c | 48 +- fs/coda/psdev.c | 4 fs/partitions/check.c | 27 + include/linux/device.h | 115 ++--- include/linux/genhd.h | 1 include/linux/i2o.h | 4 include/linux/input.h | 28 + include/linux/pm.h | 26 + lib/kobject_uevent.c | 2 net/bluetooth/hidp/core.c | 13 sound/arm/pxa2xx-ac97.c | 8 sound/core/init.c | 14 sound/core/sound.c | 2 sound/oss/soundcard.c | 4 sound/pci/ac97/ac97_bus.c | 6 sound/ppc/beep.c | 68 +-- sound/sound_core.c | 2 244 files changed, 5682 insertions(+), 5316 deletions(-)
Ben Dooks:
drivers/base - fix sparse warnings
David Brownell:
driver model wakeup flags
usb device wakeup flags
Dmitry Torokhov:
I2O: remove class interface
Driver core: send hotplug event before adding class interfaces
I2O: remove i2o_device_class
Driver core: pass interface to class interface methods drivers/input/mouse: convert to dynamic input_dev allocation drivers/input/keyboard: convert to dynamic input_dev allocation
Input: kill devfs references
Input: convert ucb1x00-ts to dynamic input_dev allocation drivers/usb/input: convert to dynamic input_dev allocation
Input: prepare to sysfs integration
Input: convert konicawc to dynamic input_dev allocation drivers/input/joystick: convert to dynamic input_dev allocation
Input: convert driver/input/misc to dynamic input_dev allocation
Input: convert onetouch to dynamic input_dev allocation
Input: convert sonypi to dynamic input_dev allocation drivers/media: convert to dynamic input_dev allocation
Input: convert drivers/macintosh to dynamic input_dev allocation drivers/input/touchscreen: convert to dynamic input_dev allocation
Input: show sysfs path in /proc/bus/input/devices
Input: convert net/bluetooth to dynamic input_dev allocation
Input: export input_dev data via sysfs attributes
Input: convert sound/ppc/beep to dynamic input_dev allocation input core: remove custom-made hotplug handler
Ed L Cashin:
aoe: use get_unaligned for accesses in ATA id buffer
aoe: update to version 14
Erik Hovland:
changes device to driver in porting.txt
kobject_uevent.c has a typo in a comment
Greg Kroah-Hartman:
Driver Core: add the ability for class_device structures to be nested
I2O: Clean up some pretty bad driver model abuses in the i2o code Driver Core: fix up all callers of class_device_create() Driver Core: document struct class_device properly
INPUT: register the input class device sooner
INPUT: export input_dev_class so that input drivers can use it.
INPUT: Fix oops when accessing sysfs files of nested input devices
INPUT: move the input class devices under their new input_dev devices update required version of udev
INPUT: remove the input_class structure, as it is unused.
INPUT: Create symlinks for backwards compatibility
INPUT: rename input_dev_class to input_class to be correct.
Jesper Juhl:
Driver Core: Big kfree NULL check cleanup - Documentation
Kay Sievers:
add sysfs attr to re-emit device hotplug event
Randy Dunlap:
kernel-doc: drivers/base fixes
Russell King:
DRIVER MODEL: Get rid of the obsolete tri-level suspend/resume callbacks
Takashi Iwai:
Fix documentation of driver suspend/resume callbacks
Will Dyson:
add sysfs support for ide tape
Jan-Benedict Glaw
Acked-byQuoted 8 lines · Greg KH
Please pull from:
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6.git/
or if master.kernel.org hasn't synced up yet:
master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6.git/Below is the diffstat and shortlog of the changes.
drivers/input/keyboard/lkkbd.c | 126 ++---
Not ACKed. This patch contains a not-fixed (though reported) wrong printk format in lkkbd_interrupt() "case LK_METRONOME:" Though I haven't tested it yet, it's ACKed by me after this is fixed.
Quoted 1 line
drivers/input/mouse/vsxxxaa.c | 84 +--
MfG, JBG
Signature · 4 lines
Jan-Benedict Glaw [email protected] . +49-172-7608481 _ O _ "Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg _ _ O für einen Freien Staat voll Freier Bürger" | im Internet! | im Irak! O O O ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
Re: [PATCH] Driver Core: document struct class_device properly
In reply to Dmitry TorokhovQuoted 13 lines · Dmitry Torokhov
Quoted 1 line · Greg KH
[PATCH] Driver Core: document struct
class_deviceproperly...
Quoted 8 lines
+ * @release: pointer to a release function for this struct
class_device. If
+ * set, this will be called instead of the class specific release function.
+ * Only use this if you want to override the default release function, like
+ * when you are nestingclass_devicestructures.
+ * @hotplug: pointer to a hotplug function for this structclass_device. If
+ * set, this will be called instead of the class specific hotplug function.
+ * Only use this if you want to override the default hotplug function, like
+ * when you are nestingclass_devicestructures.
Quoted 4 lines
Greg,
Is this solution for nesting class devices considered permanent or is it a stop-gap measure?
As I detalied a while ago, a stop-gap for now.
Quoted 9 lines
I hope it is latter as these 2 new methods allow one
class device walk all over class's intended interface and semantics and you can no longer rely that objects of the same class have similar characteristics/attributes and similar behavior. You already had to abandon using class's default attributes when dealing with nested devices, I think it is wrong long-term solution.What about Kay's proposal about moving (as far as userspace concerned) everything into
/sys/devices?
That's exactly what I am now working on. But it will take much longer than 2.6.15 to get there for that. More like the next 6 months or so at the least...
For a good description of the latest summary, see:
http://www.kroah.com/log/linux/driver_model_changes.html
thanks,
greg k-h
Quoted 6 lines · Jan-Benedict Glaw
Quoted 5 lines · Greg KH
Please pull from:
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6.git/
or if master.kernel.org hasn't synced up yet:
master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6.git/
Quoted 7 lines
Quoted 3 lines
Below is the diffstat and shortlog of the changes.
drivers/input/keyboard/lkkbd.c | 126 ++---Not ACKed. This patch contains a not-fixed (though reported) wrong printk format in
lkkbd_interrupt()"caseLK_METRONOME:" Though I haven't tested it yet, it's ACKed by me after this is fixed.
That can be a one-line add on patch once it is created. I can easily send that later.
thanks,
greg k-h
Quoted 10 lines · Greg KH
Quoted 6 lines · Jan-Benedict Glaw
Quoted 1 line · Greg KH
drivers/input/keyboard/lkkbd.c | 126 ++---Not ACKed. This patch contains a not-fixed (though reported) wrong printk format in
lkkbd_interrupt()"caseLK_METRONOME:" Though I haven't tested it yet, it's ACKed by me after this is fixed.That can be a one-line add on patch once it is created. I can easily send that later.
Jap, that's okay. But somebody needs to do that:)
MfG, JBG
Signature · 4 lines
Jan-Benedict Glaw [email protected] . +49-172-7608481 _ O _ "Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg _ _ O für einen Freien Staat voll Freier Bürger" | im Internet! | im Irak! O O O ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
Dmitry Torokhov
maintainerRe: [PATCH] Driver Core: document struct class_device properly
In reply to Greg KHQuoted 14 lines · Greg KH
Quoted 13 lines · Dmitry Torokhov
Quoted 1 line · Greg KH
[PATCH] Driver Core: document struct
class_deviceproperly...
Quoted 8 lines
+ * @release: pointer to a release function for this struct
class_device. If
+ * set, this will be called instead of the class specific release function.
+ * Only use this if you want to override the default release function, like
+ * when you are nestingclass_devicestructures.
+ * @hotplug: pointer to a hotplug function for this structclass_device. If
+ * set, this will be called instead of the class specific hotplug function.
+ * Only use this if you want to override the default hotplug function, like
+ * when you are nestingclass_devicestructures.
Quoted 7 lines
Quoted 4 lines
Greg,
Is this solution for nesting class devices considered permanent or is it a stop-gap measure?
As I detalied a while ago, a stop-gap for now.
Ok, I kind of lost track of what has been decided in the end. Thank you for confirming it.
--
Dmitry
Re: [PATCH] pci device wakeup flags
In reply to Greg KHQuoted 4 lines · Greg KH
I
thought that it was one of the usb patches in my tree that was causing you problems.
That's a separate problem. gregkh-usb-usb-pm-09.patch causes my x86 box to hang partway though boot. I drop that from -mm as well.
Re: [PATCH] pci device wakeup flags
Quoted 8 lines · Andrew Morton
Quoted 4 lines · Greg KH
I
thought that it was one of the usb patches in my tree that was causing you problems.That's a separate problem. gregkh-usb-usb-pm-09.patch causes my x86 box to hang partway though boot. I drop that from -mm as well.
Ugh, ok, at least I wasn't that far off. I'll make sure to not send the usb pm patches in the round of usb updates until that gets figured out.
thanks,
greg k-h
Re: [PATCH] pci device wakeup flags
In reply to Andrew MortonQuoted 8 lines · Andrew Morton
Quoted 4 lines · Greg KH
I
thought that it was one of the usb patches in my tree that was causing you problems.That's a separate problem. gregkh-usb-usb-pm-09.patch causes my x86 box to hang partway though boot. I drop that from -mm as well.
Just to verify: that one isn't in the current driver core tree, right? I assume that's in Greg's USB tree..
Greg?
Linus
Re: [PATCH] pci device wakeup flags
Quoted 2 lines · Greg KH
Ugh, ok, at least I wasn't that far off. I'll make sure to not send the usb pm patches in the round of usb updates until that gets figured out.
Quoted 2 lines · Linus Torvalds
Just to verify: that one isn't in the current driver core tree, right? I assume that's in Greg's USB tree..
Greg,
Any chance of putting my driver model changes into the driver core tree? ISTR the reason they ended up in the USB tree was because they clashed with the usb-pm patches. However, if the usb-pm patches are problematical, I'd rather my driver model changes weren't held up.
Alternatively, I could ask Linus to take them directly from me if you're happy for that to happen.
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 Serial core
Re: [PATCH] pci device wakeup flags
In reply to Linus TorvaldsQuoted 10 lines · Linus Torvalds
Quoted 6 lines · Andrew Morton
Quoted 4 lines · Greg KH
I
thought that it was one of the usb patches in my tree that was causing you problems.
Quoted 7 lines
Quoted 2 lines
That's a separate problem. gregkh-usb-usb-pm-09.patch causes my x86 box to hang partway though boot. I drop that from -mm as well.
Just to verify: that one isn't in the current driver core tree, right? I assume that's in Greg's USB tree..
Greg?
Yes, that is correct, that patch is not in this git tree that I asked you to pull from. All of the patches that break Andrew's boxes will not be sent to you until I figure out what is happening and fix them.
thanks,
greg k-h
Re: [PATCH] pci device wakeup flags
In reply to Russell KingQuoted 11 lines · Russell King
Quoted 2 lines · Greg KH
Ugh, ok, at least I wasn't that far off. I'll make sure to not send the usb pm patches in the round of usb updates until that gets figured out.
Quoted 2 lines · Linus Torvalds
Just to verify: that one isn't in the current driver core tree, right? I assume that's in Greg's USB tree..
Greg,
Any chance of putting my driver model changes into the driver core tree?
They are in there already. :)
Quoted 3 lines
ISTR the reason they ended up in the USB tree was because they clashed with the usb-pm patches. However, if the usb-pm patches are problematical, I'd rather my driver model changes weren't held up.
They have not been held up. I made the required usb-pm fixups already, based on your patches. They are dependant on your changes, not the other way around.
thanks,
greg k-h
Re: [PATCH] pci device wakeup flags
In reply to Linus TorvaldsQuoted 8 lines · Linus Torvalds
Quoted 3 lines · Andrew Morton
This is the patch which I've been religiously dropping from -mm because it kills my Mac G5. What are we doing merging this?
Well, since my main machine is a Mac G5, we certainly /aren't/ merging it if it kills it.
Yah, that's a known one, the problem is due to the removal of device_initialize() from pci_device_add(). The breaks the new mecanism on ppc64 that creates the PCI tree from the firmware instead of probing the bus. In addition, even with that fixed, the code looking for PME# will not be run on the pmac neither.
I'm not 100% what is the best fix at this point. I suppose it would be 2 things, let me know what you think about it:
- Have the ppc64 PCI tree code call device_initialize() itself before
calling pci_device_add()
- Move the search of PME# (and possibly other similar bits) from probe
to pci_device_add()
Ben.
Re: [PATCH] drivers/input/keyboard: convert to dynamic input_dev allocation
In reply to Dmitry TorokhovQuoted 28 lines · Dmitry Torokhov
Quoted 17 lines · Jan-Benedict Glaw
Quoted 16 lines · Greg KH
drivers/input/keyboard/lkkbd.c +3
-3@@ -435,14 +434,14 @@ lkkbd_interrupt (struct serio *serio, unswitch (data) {case LK_ALL_KEYS_UP : -input_regs (&lk->dev, regs); +input_regs (lk->dev, regs);for (i =0 ; i <ARRAY_SIZE (lkkbd_keycode); i++)if (lk->keycode[i] !=KEY_RESERVED ) -input_report_key (&lk->dev, lk->keycode[i],0 ); -input_sync (&lk->dev); +input_report_key (lk->dev, lk->keycode[i],0 ); +input_sync (lk->dev);break ;case LK_METRONOME :Quoted 9 lines
drivers/input/keyboard/lkkbd.c lkkbd_interrupt (struct serio *serio, un · line 447
Quoted 5 lines
drivers/input/keyboard/lkkbd.c +1
-1-DBG (KERN_INFO "Got LK_METRONOME and don't " +DBG (KERN_INFO "Got %#d and don't " "know how to handle...\n" );break ;case LK_OUTPUT_ERROR :The format change (%#d) should take an argument on stack, shouldn't it? But there's nothing pushed? ...or is it just a typo?
Quoted 3 lines
I think I messed it up... Was probably trying to do "default" case and then reverted back. Will fix.
That's what I wanted to do...
Signature · 58 lines
Dmitry Input: lkkbd - consolidate messages in lkkbd_interrup() Signed-off-by: Dmitry Torokhov <[email protected]> --- drivers/input/keyboard/lkkbd.c | 28 +++++----------------------- 1 files changed, 5 insertions(+), 23 deletions(-) Index: work/drivers/input/keyboard/lkkbd.c =================================================================== --- work.orig/drivers/input/keyboard/lkkbd.c +++ work/drivers/input/keyboard/lkkbd.c @@ -440,38 +440,20 @@ lkkbd_interrupt (struct serio *serio, un input_report_key (lk->dev, lk->keycode[i], 0); input_sync (lk->dev); break; + case LK_METRONOME: - DBG (KERN_INFO "Got %#d and don't " - "know how to handle...\n"); - break; case LK_OUTPUT_ERROR: - DBG (KERN_INFO "Got LK_OUTPUT_ERROR and don't " - "know how to handle...\n"); - break; case LK_INPUT_ERROR: - DBG (KERN_INFO "Got LK_INPUT_ERROR and don't " - "know how to handle...\n"); - break; case LK_KBD_LOCKED: - DBG (KERN_INFO "Got LK_KBD_LOCKED and don't " - "know how to handle...\n"); - break; case LK_KBD_TEST_MODE_ACK: - DBG (KERN_INFO "Got LK_KBD_TEST_MODE_ACK and don't " - "know how to handle...\n"); - break; case LK_PREFIX_KEY_DOWN: - DBG (KERN_INFO "Got LK_PREFIX_KEY_DOWN and don't " - "know how to handle...\n"); - break; case LK_MODE_CHANGE_ACK: - DBG (KERN_INFO "Got LK_MODE_CHANGE_ACK and ignored " - "it properly...\n"); - break; case LK_RESPONSE_RESERVED: - DBG (KERN_INFO "Got LK_RESPONSE_RESERVED and don't " - "know how to handle...\n"); + DBG (KERN_INFO + "Got 0x%02x and don't know how to handle...\n", + data); break; + case 0x01: DBG (KERN_INFO "Got 0x01, scheduling re-initialization\n"); lk->ignore_bytes = LK_NUM_IGNORE_BYTES;
Re: [PATCH] drivers/input/keyboard: convert to dynamic input_dev allocation
Quoted 42 lines · Dmitry Torokhov
On Friday 28 October 2005 02:05, Dmitry Torokhov wrote:
drivers/input/keyboard/lkkbd.c | 28 +++++----------------------- 1 files changed, 5 insertions(+), 23 deletions(-)Index:
work/drivers/input/keyboard/lkkbd.c
===================================================================drivers/input/keyboard/lkkbd.c +1
-21@@ -440,38 +440,20 @@ lkkbd_interrupt (struct serio *serio, uninput_report_key (lk->dev, lk->keycode[i],0 );input_sync (lk->dev);break ; +case LK_METRONOME : -DBG (KERN_INFO "Got %#d and don't " -"know how to handle...\n" ); -break ;case LK_OUTPUT_ERROR : -DBG (KERN_INFO "Got LK_OUTPUT_ERROR and don't " -"know how to handle...\n" ); -break ;case LK_INPUT_ERROR : -DBG (KERN_INFO "Got LK_INPUT_ERROR and don't " -"know how to handle...\n" ); -break ;case LK_KBD_LOCKED : -DBG (KERN_INFO "Got LK_KBD_LOCKED and don't " -"know how to handle...\n" ); -break ;case LK_KBD_TEST_MODE_ACK : -DBG (KERN_INFO "Got LK_KBD_TEST_MODE_ACK and don't " -"know how to handle...\n" ); -break ;case LK_PREFIX_KEY_DOWN : -DBG (KERN_INFO "Got LK_PREFIX_KEY_DOWN and don't " -"know how to handle...\n" ); -break ;case LK_MODE_CHANGE_ACK : -DBG (KERN_INFO "Got LK_MODE_CHANGE_ACK and ignored " -"it properly...\n" ); -break ;case LK_RESPONSE_RESERVED :
drivers/input/keyboard/lkkbd.c lkkbd_interrupt (struct serio *serio, un · line 459
Quoted 10 lines
drivers/input/keyboard/lkkbd.c +4
-2-DBG (KERN_INFO "Got LK_RESPONSE_RESERVED and don't " -"know how to handle...\n" ); +DBG (KERN_INFO +"Got 0x%02x and don't know how to handle...\n" , + data);break ; +case 0x01 :DBG (KERN_INFO "Got 0x01, scheduling re-initialization\n" ); lk->ignore_bytes =LK_NUM_IGNORE_BYTES ;
That'll greatly help in debugging it if needed. Thanks.
If you really want to make that switch smaller, please put some small table like
#define RESPONSE(x) { .value = x, .name = #x, }
struct {
unsigned char value;
unsigned char *name;
} response[] {
RESPONSE (LK_KBD_TEST_MODE_ACK),
RESPONSE (LK_PREFIX_KEY_DOWN),
...
};into the driver along with a small search function like
unsigned char *find_response_name (unsigned char value)
{
int i;
for (i = 0; i < ARRAY_SIZE (response); i++)
if (response[i].value == value)
return response[i].name;
return NULL;
}MfG, JBG
Signature · 4 lines
Jan-Benedict Glaw [email protected] . +49-172-7608481 _ O _ "Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg _ _ O für einen Freien Staat voll Freier Bürger" | im Internet! | im Irak! O O O ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
Re: [PATCH] drivers/input/keyboard: convert to dynamic input_dev allocation
In reply to Dmitry TorokhovHi Dmitry!
On Sat, 2005-10-29 00:59:36 -0500, Dmitry Torokhov <[email protected]> wrote:
[...a patch I don't like]
Please use this patch instead:
Input: lkkbd - consolidate messages in lkkbd_interrup()
---
lkkbd.c | 99 ++++++++++++++++++++++++++++++++++++---------------------------- 1 files changed, 57 insertions(+), 42 deletions(-)
drivers/input/keyboard/lkkbd.c +57 -42
@@ -273,11 +273,11 @@ static lk_keycode_t lkkbd_keycode[LK_NUM [0xfb] = KEY_APOSTROPHE, }; -#define CHECK_LED (LED ,BITS ) do { \ - if (test_bit (LED, lk->dev->led)) \ - leds_on |= BITS; \ - else \ - leds_off |= BITS; \ +#define CHECK_LED (LK ,VAR_ON ,VAR_OFF ,LED ,BITS ) do { \ + if (test_bit (LED, (LK)->dev->led)) \ + VAR_ON |= BITS; \ + else \ + VAR_OFF |= BITS; \ } while (0)/*
@@ -299,6 +299,40 @@ struct lkkbd { };/* +* Responses from the keyboard and mapping back to their names. +*/ +struct { +unsigned char value; +unsigned char *name; +} lk_response[] = { +#define RESPONSE(x) { .value = (x), .name = #x, } +RESPONSE (LK_STUCK_KEY ), +RESPONSE (LK_SELFTEST_FAILED ), +RESPONSE (LK_ALL_KEYS_UP ), +RESPONSE (LK_METRONOME ), +RESPONSE (LK_OUTPUT_ERROR ), +RESPONSE (LK_INPUT_ERROR ), +RESPONSE (LK_KBD_LOCKED ), +RESPONSE (LK_KBD_TEST_MODE_ACK ), +RESPONSE (LK_PREFIX_KEY_DOWN ), +RESPONSE (LK_MODE_CHANGE_ACK ), +RESPONSE (LK_RESPONSE_RESERVED ), +#undef RESPONSE +}; + +unsigned char * +response_name (unsigned char value) +{ +int i; + +for (i =0 ; i <ARRAY_SIZE (lk_response); i++) +if (lk_response[i].value == value) +return lk_response[i].name; + +return "unknown" ; +} + +/* * Calculate volume parameter byte for a given volume. */ static unsigned char
@@ -440,43 +474,24 @@ lkkbd_interrupt (struct serio *serio, uninput_report_key (lk->dev, lk->keycode[i],0 );input_sync (lk->dev);break ; -case LK_METRONOME : -DBG (KERN_INFO "Got %#d and don't " -"know how to handle...\n" ); + +case 0x01 : +DBG (KERN_INFO "Got 0x01, scheduling re-initialization\n" ); + lk->ignore_bytes =LK_NUM_IGNORE_BYTES ; + lk->id[LK_NUM_IGNORE_BYTES - lk->ignore_bytes--] = data; +schedule_work (&lk->tq);break ; + +case LK_METRONOME :case LK_OUTPUT_ERROR : -DBG (KERN_INFO "Got LK_OUTPUT_ERROR and don't " -"know how to handle...\n" ); -break ;case LK_INPUT_ERROR : -DBG (KERN_INFO "Got LK_INPUT_ERROR and don't " -"know how to handle...\n" ); -break ;case LK_KBD_LOCKED : -DBG (KERN_INFO "Got LK_KBD_LOCKED and don't " -"know how to handle...\n" ); -break ;case LK_KBD_TEST_MODE_ACK : -DBG (KERN_INFO "Got LK_KBD_TEST_MODE_ACK and don't " -"know how to handle...\n" ); -break ;case LK_PREFIX_KEY_DOWN : -DBG (KERN_INFO "Got LK_PREFIX_KEY_DOWN and don't " -"know how to handle...\n" ); -break ;case LK_MODE_CHANGE_ACK : -DBG (KERN_INFO "Got LK_MODE_CHANGE_ACK and ignored " -"it properly...\n" ); -break ;case LK_RESPONSE_RESERVED : -DBG (KERN_INFO "Got LK_RESPONSE_RESERVED and don't " -"know how to handle...\n" ); -break ; -case 0x01 : -DBG (KERN_INFO "Got 0x01, scheduling re-initialization\n" ); - lk->ignore_bytes =LK_NUM_IGNORE_BYTES ; - lk->id[LK_NUM_IGNORE_BYTES - lk->ignore_bytes--] = data; -schedule_work (&lk->tq); +DBG (KERN_INFO "Got %s and don't know how to handle...\n" , +response_name (data));break ;default :
@@ -509,10 +524,10 @@ lkkbd_event (struct input_dev *dev, unsiswitch (type) {case EV_LED : -CHECK_LED (LED_CAPSL ,LK_LED_SHIFTLOCK ); -CHECK_LED (LED_COMPOSE ,LK_LED_COMPOSE ); -CHECK_LED (LED_SCROLLL ,LK_LED_SCROLLLOCK ); -CHECK_LED (LED_SLEEP ,LK_LED_WAIT ); +CHECK_LED (lk, leds_on, leds_off,LED_CAPSL ,LK_LED_SHIFTLOCK ); +CHECK_LED (lk, leds_on, leds_off,LED_COMPOSE ,LK_LED_COMPOSE ); +CHECK_LED (lk, leds_on, leds_off,LED_SCROLLL ,LK_LED_SCROLLLOCK ); +CHECK_LED (lk, leds_on, leds_off,LED_SLEEP ,LK_LED_WAIT );if (leds_on !=0 ) { lk->serio->write (lk->serio,LK_CMD_LED_ON ); lk->serio->write (lk->serio, leds_on);
@@ -574,10 +589,10 @@ lkkbd_reinit (void *data) lk->serio->write (lk->serio,LK_CMD_SET_DEFAULTS );/* Set LEDs */ -CHECK_LED (LED_CAPSL ,LK_LED_SHIFTLOCK ); -CHECK_LED (LED_COMPOSE ,LK_LED_COMPOSE ); -CHECK_LED (LED_SCROLLL ,LK_LED_SCROLLLOCK ); -CHECK_LED (LED_SLEEP ,LK_LED_WAIT ); +CHECK_LED (lk, leds_on, leds_off,LED_CAPSL ,LK_LED_SHIFTLOCK ); +CHECK_LED (lk, leds_on, leds_off,LED_COMPOSE ,LK_LED_COMPOSE ); +CHECK_LED (lk, leds_on, leds_off,LED_SCROLLL ,LK_LED_SCROLLLOCK ); +CHECK_LED (lk, leds_on, leds_off,LED_SLEEP ,LK_LED_WAIT );if (leds_on !=0 ) { lk->serio->write (lk->serio,LK_CMD_LED_ON ); lk->serio->write (lk->serio, leds_on);
Thanks, JBG
Signature · 4 lines
Jan-Benedict Glaw [email protected] . +49-172-7608481 _ O _ "Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg _ _ O für einen Freien Staat voll Freier Bürger" | im Internet! | im Irak! O O O ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
Re: [PATCH] drivers/input/keyboard: convert to dynamic input_dev allocation
Quoted 6 lines · Jan-Benedict Glaw
Hi Dmitry!
On Sat, 2005-10-29 00:59:36 -0500, Dmitry Torokhov <[email protected]> wrote:
[...a patch I don't like]
[ .. a patch that now I don't like ..]
The messages are only generated when someone explicitely enables LKKBD_DEBUG, and if someone does enable it he surely can map the numeric values himself. There is no need to clutter the code with insignificant details.
Signature · 1 line
Dmitry
Re: [PATCH] drivers/input/keyboard: convert to dynamic input_dev allocation
Quoted 9 lines · Dmitry Torokhov
Quoted 3 lines · Jan-Benedict Glaw
On Sat, 2005-10-29 00:59:36 -0500, Dmitry Torokhov <[email protected]> wrote:
[...a patch I don't like]
[ .. a patch that now I don't like ..]
The messages are only generated when someone explicitely enables
LKKBD_DEBUG, and if someone does enable it he surely can map the numeric values himself. There is no need to clutter the code with insignificant details.
Actually, I think there is. It should just be easy to use; albeit that, if you look precisely at it, there are some defines etc that aren't even used. Why? Because it documents the hardware.
I didn't like the larce switch either, but I kept it there for a reason. So I'd really like to keep the ability to print out these values by name. I don't think it hurts, so please keep it there.
Here's a revised version of the patch, making the function and it's data static, as well as stuffing them into #ifdef DEBUG.
drivers/input/keyboard/lkkbd.c +59 -42
@@ -273,11 +273,11 @@ static lk_keycode_t lkkbd_keycode[LK_NUM [0xfb] = KEY_APOSTROPHE, }; -#define CHECK_LED (LED ,BITS ) do { \ - if (test_bit (LED, lk->dev->led)) \ - leds_on |= BITS; \ - else \ - leds_off |= BITS; \ +#define CHECK_LED (LK ,VAR_ON ,VAR_OFF ,LED ,BITS ) do { \ + if (test_bit (LED, (LK)->dev->led)) \ + VAR_ON |= BITS; \ + else \ + VAR_OFF |= BITS; \ } while (0)/*
@@ -298,6 +298,42 @@ struct lkkbd {int ctrlclick_volume; }; +#ifdef LKKBD_DEBUG +/* +* Responses from the keyboard and mapping back to their names. +*/ +static struct { +unsigned char value; +unsigned char *name; +} lk_response[] = { +#define RESPONSE(x) { .value = (x), .name = #x, } +RESPONSE (LK_STUCK_KEY ), +RESPONSE (LK_SELFTEST_FAILED ), +RESPONSE (LK_ALL_KEYS_UP ), +RESPONSE (LK_METRONOME ), +RESPONSE (LK_OUTPUT_ERROR ), +RESPONSE (LK_INPUT_ERROR ), +RESPONSE (LK_KBD_LOCKED ), +RESPONSE (LK_KBD_TEST_MODE_ACK ), +RESPONSE (LK_PREFIX_KEY_DOWN ), +RESPONSE (LK_MODE_CHANGE_ACK ), +RESPONSE (LK_RESPONSE_RESERVED ), +#undef RESPONSE +}; + +static unsigned char * +response_name (unsigned char value) +{ +int i; + +for (i =0 ; i <ARRAY_SIZE (lk_response); i++) +if (lk_response[i].value == value) +return lk_response[i].name; + +return "unknown" ; +} +#endif /* LKKBD_DEBUG */ +/* * Calculate volume parameter byte for a given volume. */
@@ -440,43 +476,24 @@ lkkbd_interrupt (struct serio *serio, uninput_report_key (lk->dev, lk->keycode[i],0 );input_sync (lk->dev);break ; -case LK_METRONOME : -DBG (KERN_INFO "Got %#d and don't " -"know how to handle...\n" ); + +case 0x01 : +DBG (KERN_INFO "Got 0x01, scheduling re-initialization\n" ); + lk->ignore_bytes =LK_NUM_IGNORE_BYTES ; + lk->id[LK_NUM_IGNORE_BYTES - lk->ignore_bytes--] = data; +schedule_work (&lk->tq);break ; + +case LK_METRONOME :case LK_OUTPUT_ERROR : -DBG (KERN_INFO "Got LK_OUTPUT_ERROR and don't " -"know how to handle...\n" ); -break ;case LK_INPUT_ERROR : -DBG (KERN_INFO "Got LK_INPUT_ERROR and don't " -"know how to handle...\n" ); -break ;case LK_KBD_LOCKED : -DBG (KERN_INFO "Got LK_KBD_LOCKED and don't " -"know how to handle...\n" ); -break ;case LK_KBD_TEST_MODE_ACK : -DBG (KERN_INFO "Got LK_KBD_TEST_MODE_ACK and don't " -"know how to handle...\n" ); -break ;case LK_PREFIX_KEY_DOWN : -DBG (KERN_INFO "Got LK_PREFIX_KEY_DOWN and don't " -"know how to handle...\n" ); -break ;case LK_MODE_CHANGE_ACK : -DBG (KERN_INFO "Got LK_MODE_CHANGE_ACK and ignored " -"it properly...\n" ); -break ;case LK_RESPONSE_RESERVED : -DBG (KERN_INFO "Got LK_RESPONSE_RESERVED and don't " -"know how to handle...\n" ); -break ; -case 0x01 : -DBG (KERN_INFO "Got 0x01, scheduling re-initialization\n" ); - lk->ignore_bytes =LK_NUM_IGNORE_BYTES ; - lk->id[LK_NUM_IGNORE_BYTES - lk->ignore_bytes--] = data; -schedule_work (&lk->tq); +DBG (KERN_INFO "Got %s and don't know how to handle...\n" , +response_name (data));break ;default :
@@ -509,10 +526,10 @@ lkkbd_event (struct input_dev *dev, unsiswitch (type) {case EV_LED : -CHECK_LED (LED_CAPSL ,LK_LED_SHIFTLOCK ); -CHECK_LED (LED_COMPOSE ,LK_LED_COMPOSE ); -CHECK_LED (LED_SCROLLL ,LK_LED_SCROLLLOCK ); -CHECK_LED (LED_SLEEP ,LK_LED_WAIT ); +CHECK_LED (lk, leds_on, leds_off,LED_CAPSL ,LK_LED_SHIFTLOCK ); +CHECK_LED (lk, leds_on, leds_off,LED_COMPOSE ,LK_LED_COMPOSE ); +CHECK_LED (lk, leds_on, leds_off,LED_SCROLLL ,LK_LED_SCROLLLOCK ); +CHECK_LED (lk, leds_on, leds_off,LED_SLEEP ,LK_LED_WAIT );if (leds_on !=0 ) { lk->serio->write (lk->serio,LK_CMD_LED_ON ); lk->serio->write (lk->serio, leds_on);
@@ -574,10 +591,10 @@ lkkbd_reinit (void *data) lk->serio->write (lk->serio,LK_CMD_SET_DEFAULTS );/* Set LEDs */ -CHECK_LED (LED_CAPSL ,LK_LED_SHIFTLOCK ); -CHECK_LED (LED_COMPOSE ,LK_LED_COMPOSE ); -CHECK_LED (LED_SCROLLL ,LK_LED_SCROLLLOCK ); -CHECK_LED (LED_SLEEP ,LK_LED_WAIT ); +CHECK_LED (lk, leds_on, leds_off,LED_CAPSL ,LK_LED_SHIFTLOCK ); +CHECK_LED (lk, leds_on, leds_off,LED_COMPOSE ,LK_LED_COMPOSE ); +CHECK_LED (lk, leds_on, leds_off,LED_SCROLLL ,LK_LED_SCROLLLOCK ); +CHECK_LED (lk, leds_on, leds_off,LED_SLEEP ,LK_LED_WAIT );if (leds_on !=0 ) { lk->serio->write (lk->serio,LK_CMD_LED_ON ); lk->serio->write (lk->serio, leds_on);
MfG, JBG
Signature · 4 lines
Jan-Benedict Glaw [email protected] . +49-172-7608481 _ O _ "Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg _ _ O für einen Freien Staat voll Freier Bürger" | im Internet! | im Irak! O O O ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
Re: [PATCH] driver model wakeup flags
In reply to Greg KHHi!
Quoted 4 lines
* There's a writeable sysfs "wakeup" file, with one of two values:
- "enabled", when the policy is to allow wakeup
- "disabled", when the policy is not to allow it
- "" if the device can't currently issue wakeups
Could we either get "not-supported" value here, or remove the file if it is not supported? Having empty file is ugly...
Signature · 1 line
64 bytes from 195.113.31.123: icmp_seq=28 ttl=51 time=448769.1 ms
Re: [PATCH] drivers/input/keyboard: convert to dynamic input_dev allocation
In reply to Jan-Benedict GlawQuoted 3 lines · Jan-Benedict Glaw
Here's a revised version of the patch, making the function and it's data static, as well as stuffing them into #ifdef DEBUG.
If you could resend the patch with Signed-off-by line I would add it to my input tree.
Thanks!
Signature · 1 line
Dmitry
PATCH 1/1 input/lkkbd: misc fixes
Quoted 6 lines · Dmitry Torokhov
Quoted 2 lines · Jan-Benedict Glaw
Here's a revised version of the patch, making the function and it's data static, as well as stuffing them into #ifdef DEBUG.
If you could resend the patch with Signed-off-by line I would add it to my input tree.
Thanks a lot, so here it is, against current git.
This patch fixes three issues with the lkkbd.c driver:
* Fix a printk() format to match the stack
* Hide debugging code into #ifdef, which allows to simplify the large switch statement
* Update macros to not reference variables not given as arguments
--- lkkbd.c | 101 +++++++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 59 insertions(+), 42 deletions(-)
drivers/input/keyboard/lkkbd.c +59 -42
@@ -273,11 +273,11 @@ static lk_keycode_t lkkbd_keycode[LK_NUM [0xfb] = KEY_APOSTROPHE, }; -#define CHECK_LED (LED ,BITS ) do { \ - if (test_bit (LED, lk->dev->led)) \ - leds_on |= BITS; \ - else \ - leds_off |= BITS; \ +#define CHECK_LED (LK ,VAR_ON ,VAR_OFF ,LED ,BITS ) do { \ + if (test_bit (LED, (LK)->dev->led)) \ + VAR_ON |= BITS; \ + else \ + VAR_OFF |= BITS; \ } while (0)/*
@@ -298,6 +298,42 @@ struct lkkbd {int ctrlclick_volume; }; +#ifdef LKKBD_DEBUG +/* +* Responses from the keyboard and mapping back to their names. +*/ +static struct { +unsigned char value; +unsigned char *name; +} lk_response[] = { +#define RESPONSE(x) { .value = (x), .name = #x, } +RESPONSE (LK_STUCK_KEY ), +RESPONSE (LK_SELFTEST_FAILED ), +RESPONSE (LK_ALL_KEYS_UP ), +RESPONSE (LK_METRONOME ), +RESPONSE (LK_OUTPUT_ERROR ), +RESPONSE (LK_INPUT_ERROR ), +RESPONSE (LK_KBD_LOCKED ), +RESPONSE (LK_KBD_TEST_MODE_ACK ), +RESPONSE (LK_PREFIX_KEY_DOWN ), +RESPONSE (LK_MODE_CHANGE_ACK ), +RESPONSE (LK_RESPONSE_RESERVED ), +#undef RESPONSE +}; + +static unsigned char * +response_name (unsigned char value) +{ +int i; + +for (i =0 ; i <ARRAY_SIZE (lk_response); i++) +if (lk_response[i].value == value) +return lk_response[i].name; + +return "<unknown>" ; +} +#endif /* LKKBD_DEBUG */ +/* * Calculate volume parameter byte for a given volume. */
@@ -440,43 +476,24 @@ lkkbd_interrupt (struct serio *serio, uninput_report_key (lk->dev, lk->keycode[i],0 );input_sync (lk->dev);break ; -case LK_METRONOME : -DBG (KERN_INFO "Got %#d and don't " -"know how to handle...\n" ); + +case 0x01 : +DBG (KERN_INFO "Got 0x01, scheduling re-initialization\n" ); + lk->ignore_bytes =LK_NUM_IGNORE_BYTES ; + lk->id[LK_NUM_IGNORE_BYTES - lk->ignore_bytes--] = data; +schedule_work (&lk->tq);break ; + +case LK_METRONOME :case LK_OUTPUT_ERROR : -DBG (KERN_INFO "Got LK_OUTPUT_ERROR and don't " -"know how to handle...\n" ); -break ;case LK_INPUT_ERROR : -DBG (KERN_INFO "Got LK_INPUT_ERROR and don't " -"know how to handle...\n" ); -break ;case LK_KBD_LOCKED : -DBG (KERN_INFO "Got LK_KBD_LOCKED and don't " -"know how to handle...\n" ); -break ;case LK_KBD_TEST_MODE_ACK : -DBG (KERN_INFO "Got LK_KBD_TEST_MODE_ACK and don't " -"know how to handle...\n" ); -break ;case LK_PREFIX_KEY_DOWN : -DBG (KERN_INFO "Got LK_PREFIX_KEY_DOWN and don't " -"know how to handle...\n" ); -break ;case LK_MODE_CHANGE_ACK : -DBG (KERN_INFO "Got LK_MODE_CHANGE_ACK and ignored " -"it properly...\n" ); -break ;case LK_RESPONSE_RESERVED : -DBG (KERN_INFO "Got LK_RESPONSE_RESERVED and don't " -"know how to handle...\n" ); -break ; -case 0x01 : -DBG (KERN_INFO "Got 0x01, scheduling re-initialization\n" ); - lk->ignore_bytes =LK_NUM_IGNORE_BYTES ; - lk->id[LK_NUM_IGNORE_BYTES - lk->ignore_bytes--] = data; -schedule_work (&lk->tq); +DBG (KERN_INFO "Got %s and don't know how to handle...\n" , +response_name (data));break ;default :
@@ -509,10 +526,10 @@ lkkbd_event (struct input_dev *dev, unsiswitch (type) {case EV_LED : -CHECK_LED (LED_CAPSL ,LK_LED_SHIFTLOCK ); -CHECK_LED (LED_COMPOSE ,LK_LED_COMPOSE ); -CHECK_LED (LED_SCROLLL ,LK_LED_SCROLLLOCK ); -CHECK_LED (LED_SLEEP ,LK_LED_WAIT ); +CHECK_LED (lk, leds_on, leds_off,LED_CAPSL ,LK_LED_SHIFTLOCK ); +CHECK_LED (lk, leds_on, leds_off,LED_COMPOSE ,LK_LED_COMPOSE ); +CHECK_LED (lk, leds_on, leds_off,LED_SCROLLL ,LK_LED_SCROLLLOCK ); +CHECK_LED (lk, leds_on, leds_off,LED_SLEEP ,LK_LED_WAIT );if (leds_on !=0 ) { lk->serio->write (lk->serio,LK_CMD_LED_ON ); lk->serio->write (lk->serio, leds_on);
@@ -574,10 +591,10 @@ lkkbd_reinit (void *data) lk->serio->write (lk->serio,LK_CMD_SET_DEFAULTS );/* Set LEDs */ -CHECK_LED (LED_CAPSL ,LK_LED_SHIFTLOCK ); -CHECK_LED (LED_COMPOSE ,LK_LED_COMPOSE ); -CHECK_LED (LED_SCROLLL ,LK_LED_SCROLLLOCK ); -CHECK_LED (LED_SLEEP ,LK_LED_WAIT ); +CHECK_LED (lk, leds_on, leds_off,LED_CAPSL ,LK_LED_SHIFTLOCK ); +CHECK_LED (lk, leds_on, leds_off,LED_COMPOSE ,LK_LED_COMPOSE ); +CHECK_LED (lk, leds_on, leds_off,LED_SCROLLL ,LK_LED_SCROLLLOCK ); +CHECK_LED (lk, leds_on, leds_off,LED_SLEEP ,LK_LED_WAIT );if (leds_on !=0 ) { lk->serio->write (lk->serio,LK_CMD_LED_ON ); lk->serio->write (lk->serio, leds_on);
Signature · 4 lines
Jan-Benedict Glaw [email protected] . +49-172-7608481 _ O _ "Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg _ _ O für einen Freien Staat voll Freier Bürger" | im Internet! | im Irak! O O O ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
Re: [PATCH] driver model wakeup flags
In reply to Pavel MachekQuoted 9 lines · Pavel Machek
Hi!
Quoted 4 lines
* There's a writeable sysfs "wakeup" file, with one of two values:
- "enabled", when the policy is to allow wakeup
- "disabled", when the policy is not to allow it
- "" if the device can't currently issue wakeupsCould we either get "not-supported" value here, or remove the file if it is not supported? Having empty file is ugly...
Sure, have a patch for this? :)
thanks,
greg k-h
Re: [PATCH] driver model wakeup flags
Quoted 8 lines · Greg KH
Quoted 7 lines · Pavel Machek
Hi!
Quoted 4 lines
* There's a writeable sysfs "wakeup" file, with one of two values:
- "enabled", when the policy is to allow wakeup
- "disabled", when the policy is not to allow it
- "" if the device can't currently issue wakeups
Quoted 4 lines
Quoted 2 lines
Could we either get "not-supported" value here, or remove the file if it is not supported? Having empty file is ugly...
Sure, have a patch for this? :)
Turns out that "remove if not supported" is impractical; I did have that implemented, and backed it out as I got deeper into testing.
For one example, the "can wakeup" for USB devices is a function of what configuration the device is in ... so a device with two configurations (call them #5 and #42) as well as "unconfigured" (config #0) might not support wakeup in two of its three states; maybe only #42 supports remote wakeup.
Yes, those empty files bothered me a bit too.
- Dave
Re: [PATCH] Driver Core: document struct class_device properly
In reply to Greg KHQuoted 6 lines · Greg KH
Quoted 2 lines
What about Kay's proposal about moving (as far as userspace concerned) everything into
/sys/devices?That's exactly what I am now working on. But it will take much longer than 2.6.15 to get there for that. More like the next 6 months or so at the least...
BTW, is there a reason why "devices" is plural, as opposed to the singular names used for other directories holding types of objects ("/sys/class" "/sys/bus" "/dev" "/lib" etc.)?
Thanks,
-Miles
Signature · 2 lines
`There are more things in heaven and earth, Horatio, Than are dreamt of in your philosophy.'
Re: [PATCH] Driver Core: document struct class_device properly
Quoted 11 lines · Miles Bader
Quoted 6 lines · Greg KH
Quoted 2 lines
What about Kay's proposal about moving (as far as userspace concerned) everything into
/sys/devices?That's exactly what I am now working on. But it will take much longer than 2.6.15 to get there for that. More like the next 6 months or so at the least...
BTW, is there a reason why "devices" is plural, as opposed to the singular names used for other directories holding types of objects ("
/sys/class" "/sys/bus" "/dev" "/lib" etc.)?
That's just the way it happened, no real "reason" behind it :)
thanks,
greg k-h