drivers/input: Use pr_<level>
Subsystems (11)
PATCH 1/1 drivers/input: Use pr_<level>
Remove prefixes from printks and convert to pr_fmt/pr_<level>.
Always make output prefix match module name. There are some existing uses that do not. For instance:
spaceorb used "input: " once, probably a copy/paste error, newtonkbd as well. Synaptics used "serio: ", etc.
A few miscellaneous typos corrected.
Converted a few uses of usb macros err to pr_err.
Compiled x86 only, some files not compile tested
--- drivers/input/apm-power.c | 14 ++--- drivers/input/evbug.c | 18 ++++--- drivers/input/evdev.c | 15 +++--- drivers/input/ff-core.c | 6 +- drivers/input/ff-memless.c | 8 ++-- drivers/input/gameport/emu10k1-gp.c | 4 +- drivers/input/gameport/fm801-gp.c | 8 ++- drivers/input/gameport/lightning.c | 6 ++- drivers/input/gameport/ns558.c | 8 ++- drivers/input/input-polldev.c | 5 +- drivers/input/input.c | 22 ++++---- drivers/input/joydev.c | 4 +- drivers/input/joystick/a3d.c | 9 ++- drivers/input/joystick/adi.c | 12 +++-- drivers/input/joystick/amijoy.c | 4 +- drivers/input/joystick/analog.c | 15 +++-- drivers/input/joystick/cobra.c | 7 ++- drivers/input/joystick/db9.c | 16 +++--- drivers/input/joystick/gf2k.c | 7 ++- drivers/input/joystick/grip_mp.c | 15 +++-- drivers/input/joystick/guillemot.c | 11 +++- drivers/input/joystick/iforce/iforce-packets.c | 8 ++- drivers/input/joystick/interact.c | 7 ++- drivers/input/joystick/joydump.c | 40 ++++++++------- drivers/input/joystick/sidewinder.c | 58 ++++++++++++---------- drivers/input/joystick/spaceball.c | 6 ++- drivers/input/joystick/spaceorb.c | 15 ++++-- drivers/input/joystick/turbografx.c | 16 +++--- drivers/input/joystick/walkera0701.c | 6 ++- drivers/input/joystick/xpad.c | 4 +- drivers/input/keyboard/amikbd.c | 42 +++++++++++----- drivers/input/keyboard/atakbd.c | 4 +- drivers/input/keyboard/hil_kbd.c | 21 +++----- drivers/input/keyboard/hilkbd.c | 26 +++++----- drivers/input/keyboard/jornada680_kbd.c | 5 +- drivers/input/keyboard/jornada720_kbd.c | 10 ++-- drivers/input/keyboard/lkkbd.c | 54 ++++++++++---------- drivers/input/keyboard/locomokbd.c | 6 ++- drivers/input/keyboard/newtonkbd.c | 4 +- drivers/input/keyboard/omap-keypad.c | 25 +++++----- drivers/input/keyboard/sunkbd.c | 9 ++-- drivers/input/keyboard/xtkbd.c | 7 ++- drivers/input/misc/ati_remote.c | 22 +++++---- drivers/input/misc/ati_remote2.c | 6 ++- drivers/input/misc/cm109.c | 23 +++----- drivers/input/misc/hp_sdc_rtc.c | 10 ++-- drivers/input/misc/m68kspkr.c | 4 +- drivers/input/misc/powermate.c | 19 ++++--- drivers/input/misc/uinput.c | 18 ++++--- drivers/input/misc/winbond-cir.c | 6 ++- drivers/input/misc/wistron_btns.c | 29 ++++++----- drivers/input/misc/yealink.c | 5 +- drivers/input/mouse/alps.c | 12 +++-- drivers/input/mouse/appletouch.c | 64 +++++++++++------------ drivers/input/mouse/bcm5974.c | 48 +++++++++--------- drivers/input/mouse/elantech.c | 4 +- drivers/input/mouse/inport.c | 8 ++- drivers/input/mouse/lifebook.c | 5 +- drivers/input/mouse/logibm.c | 10 ++-- drivers/input/mouse/logips2pp.c | 13 +++-- drivers/input/mouse/pc110pad.c | 10 ++-- drivers/input/mouse/psmouse-base.c | 52 ++++++++++--------- drivers/input/mouse/rpcmouse.c | 4 +- drivers/input/mouse/sentelic.c | 13 +++-- drivers/input/mouse/sermouse.c | 6 ++- drivers/input/mouse/synaptics.c | 30 ++++++----- drivers/input/mouse/trackpoint.c | 10 ++-- drivers/input/mouse/vsxxxaa.c | 44 ++++++++--------- drivers/input/mousedev.c | 10 ++-- drivers/input/serio/ambakmi.c | 5 ++- drivers/input/serio/ct82c710.c | 10 ++-- drivers/input/serio/gscps2.c | 15 +++--- drivers/input/serio/hil_mlc.c | 17 +++--- drivers/input/serio/hp_sdc.c | 53 ++++++++++---------- drivers/input/serio/hp_sdc_mlc.c | 45 +++++++++-------- drivers/input/serio/i8042-x86ia64io.h | 43 +++++++--------- drivers/input/serio/i8042.c | 62 ++++++++++------------- drivers/input/serio/i8042.h | 21 +++++--- drivers/input/serio/maceps2.c | 5 ++- drivers/input/serio/parkbd.c | 8 ++- drivers/input/serio/q40kbd.c | 6 ++- drivers/input/serio/rpckbd.c | 6 ++- drivers/input/serio/sa1111ps2.c | 17 ++++--- drivers/input/serio/serio_raw.c | 10 ++-- drivers/input/serio/serport.c | 6 ++- drivers/input/tablet/acecad.c | 5 +- drivers/input/tablet/aiptek.c | 7 ++- drivers/input/tablet/gtco.c | 2 +- drivers/input/tablet/kbtab.c | 5 +- drivers/input/tablet/wacom_sys.c | 7 ++- drivers/input/tablet/wacom_wac.c | 8 ++- drivers/input/touchscreen/gunze.c | 5 ++- drivers/input/touchscreen/h3600_ts_input.c | 8 ++- drivers/input/touchscreen/hp680_ts_input.c | 3 +- drivers/input/touchscreen/htcpen.c | 15 +++--- drivers/input/touchscreen/inexio.c | 5 ++- drivers/input/touchscreen/jornada720_ts.c | 4 +- drivers/input/touchscreen/mk712.c | 10 ++-- drivers/input/touchscreen/mtouch.c | 7 ++- drivers/input/touchscreen/ucb1400_ts.c | 12 +++-- drivers/input/touchscreen/usbtouchscreen.c | 6 ++- drivers/input/xen-kbdfront.c | 10 ++-- 102 files changed, 844 insertions(+), 676 deletions(-)
drivers/input/apm-power.c +6 -8
@@ -9,6 +9,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/input.h> #include <linux/slab.h>
@@ -23,8 +25,7 @@ static void system_power_event(unsigned int keycode)switch (keycode) {case KEY_SUSPEND :apm_queue_event (APM_USER_SUSPEND ); - -printk (KERN_INFO "apm-power: Requesting system suspend...\n" ); +pr_info ("Requesting system suspend...\n" );break ;default :break ;
@@ -65,18 +66,15 @@ static int apmpower_connect(struct input_handler *handler, error =input_register_handle (handle);if (error) { -printk (KERN_ERR -"apm-power: Failed to register input power handler, " -"error %d\n" , error); +pr_err ("Failed to register input power handler, error %d\n" , + error);kfree (handle);return error; } error =input_open_device (handle);if (error) { -printk (KERN_ERR -"apm-power: Failed to open input power device, " -"error %d\n" , error); +pr_err ("Failed to open input power device, error %d\n" , error);input_unregister_handle (handle);kfree (handle);return error;
drivers/input/evbug.c +10 -8
@@ -26,6 +26,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/slab.h> #include <linux/module.h> #include <linux/input.h>
@@ -38,8 +40,8 @@ MODULE_LICENSE("GPL");static void evbug_event (struct input_handle *handle,unsigned int type,unsigned int code,int value) { -printk (KERN_DEBUG "evbug.c: Event. Dev: %s, Type: %d, Code: %d, Value: %d\n" , -dev_name (&handle->dev->dev), type, code, value); + printk(KERN_DEBUG pr_fmt("Event. Dev: %s, Type: %d, Code: %d, Value: %d\n"), + dev_name(&handle->dev->dev), type, code, value); } static int evbug_connect(struct input_handler *handler, struct input_dev *dev,
@@ -64,10 +66,10 @@ static int evbug_connect(struct input_handler *handler, struct input_dev *dev,if (error) goto err_unregister_handle; -printk (KERN_DEBUG "evbug.c: Connected device: %s (%s at %s)\n" , -dev_name (&dev->dev), - dev->name ?:"unknown" , - dev->phys ?:"unknown" ); + printk(KERN_DEBUG pr_fmt("Connected device: %s (%s at %s)\n"), +dev_name (&dev->dev), + dev->name ?:"unknown" , + dev->phys ?: "unknown");return 0 ;
@@ -80,8 +82,8 @@ static int evbug_connect(struct input_handler *handler, struct input_dev *dev,static void evbug_disconnect (struct input_handle *handle) { -printk (KERN_DEBUG "evbug.c: Disconnected device: %s\n" , -dev_name (&handle->dev->dev)); + printk(KERN_DEBUG pr_fmt("Disconnected device: %s\n"), + dev_name(&handle->dev->dev));input_close_device (handle);input_unregister_handle (handle);
drivers/input/evdev.c +8 -7
@@ -8,6 +8,8 @@* the Free Software Foundation. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#define EVDEV_MINOR_BASE 64#define EVDEV_MINORS 32#define EVDEV_MIN_BUFFER_SIZE 64U
@@ -520,12 +522,11 @@ static int handle_eviocgbit(struct input_dev *dev, unsigned int cmd, void __userif ((_IOC_NR (cmd) &EV_MAX ) ==EV_KEY &&_IOC_SIZE (cmd) ==OLD_KEY_MAX ) { len =OLD_KEY_MAX ;if (printk_timed_ratelimit (&keymax_warn_time,10 *1000 )) -printk (KERN_WARNING -"evdev.c(EVIOCGBIT): Suspicious buffer size %u, " -"limiting output to %zu bytes. See " -"http://userweb.kernel.org/~dtor/eviocgbit-bug.html\n" , -OLD_KEY_MAX , -BITS_TO_LONGS (OLD_KEY_MAX ) *sizeof (long )); +pr_warning ("(EVIOCGBIT): Suspicious buffer size %u, " +"limiting output to %zu bytes. See " +"http://userweb.kernel.org/~dtor/eviocgbit-bug.html\n" , +OLD_KEY_MAX , +BITS_TO_LONGS (OLD_KEY_MAX ) *sizeof (long )); }return bits_to_user (bits, len,_IOC_SIZE (cmd), p, compat_mode);
@@ -872,7 +873,7 @@ static int evdev_connect(struct input_handler *handler, struct input_dev *dev,break ;if (minor ==EVDEV_MINORS ) { -printk (KERN_ERR "evdev: no more free evdev devices\n" ); +pr_err ("no more free evdev devices\n" );return -ENFILE ; }
drivers/input/ff-core.c +3 -3
@@ -23,7 +23,8 @@/* #define DEBUG */ -#define debug(format, arg...) pr_debug("ff-core: " format "\n", ## arg) +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#define debug(format, arg...) pr_debug(format "\n", ## arg)#include <linux/input.h> #include <linux/module.h>
@@ -315,8 +316,7 @@ int input_ff_create(struct input_dev *dev, int max_effects)int i;if (!max_effects) { -printk (KERN_ERR -"ff-core: cannot allocate device without any effects\n" ); +pr_err ("cannot allocate device without any effects\n" );return -EINVAL ; }
drivers/input/ff-memless.c +4 -4
@@ -23,7 +23,8 @@/* #define DEBUG */ -#define debug(format, arg...) pr_debug("ff-memless: " format "\n", ## arg) +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#define debug(format, arg...) pr_debug(format "\n", ##arg)#include <linux/slab.h> #include <linux/input.h>
@@ -215,8 +216,7 @@ static int get_compatible_type(struct ff_device *ff, int effect_type)if (effect_type ==FF_PERIODIC &&test_bit (FF_RUMBLE , ff->ffbit))return FF_RUMBLE ; -printk (KERN_ERR -"ff-memless: invalid type in get_compatible_type()\n" ); +pr_err ("invalid type in get_compatible_type()\n" );return 0 ; }
@@ -312,7 +312,7 @@ static void ml_combine_effects(struct ff_effect *effect,break ;default : -printk (KERN_ERR "ff-memless: invalid type in ml_combine_effects()\n" ); +pr_err ("invalid type in ml_combine_effects()\n" );break ; }
drivers/input/gameport/emu10k1-gp.c +3 -1
@@ -26,6 +26,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <asm/io.h> #include <linux/module.h>
@@ -75,7 +77,7 @@ static int __devinit emu_probe(struct pci_dev *pdev, const struct pci_device_id emu =kzalloc (sizeof (struct emu ),GFP_KERNEL ); port =gameport_allocate_port ();if (!emu || !port) { -printk (KERN_ERR "emu10k1-gp: Memory allocation failed\n" ); +pr_err ("Memory allocation failed\n" );release_region (ioport, iolen);kfree (emu);gameport_free_port (port);
drivers/input/gameport/fm801-gp.c +5 -3
@@ -20,6 +20,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <asm/io.h> #include <linux/delay.h> #include <linux/errno.h>
@@ -87,7 +89,7 @@ static int __devinit fm801_gp_probe(struct pci_dev *pci, const struct pci_device gp =kzalloc (sizeof (struct fm801_gp ),GFP_KERNEL ); port =gameport_allocate_port ();if (!gp || !port) { -printk (KERN_ERR "fm801-gp: Memory allocation failed\n" ); +pr_err ("Memory allocation failed\n" ); error = -ENOMEM ; goto err_out_free; }
@@ -108,8 +110,8 @@ static int __devinit fm801_gp_probe(struct pci_dev *pci, const struct pci_device gp->gameport = port; gp->res_port =request_region (port->io,0x10 ,"FM801 GP" );if (!gp->res_port) { -printk (KERN_DEBUG "fm801-gp: unable to grab region 0x%x-0x%x\n" , - port->io, port->io +0x0f ); + printk(KERN_DEBUG pr_fmt("unable to grab region 0x%x-0x%x\n"), + port->io, port->io + 0x0f); error = -EBUSY ; goto err_out_disable_dev; }
drivers/input/gameport/lightning.c +4 -2
@@ -26,6 +26,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <asm/io.h> #include <linux/delay.h> #include <linux/errno.h>
@@ -228,7 +230,7 @@ static int __init l4_create_ports(int card_no) l4 = &l4_ports[idx];if (!(l4->gameport = port =gameport_allocate_port ())) { -printk (KERN_ERR "lightning: Memory allocation failed\n" ); +pr_err ("Memory allocation failed\n" );while (--i >=0 ) {gameport_free_port (l4->gameport); l4->gameport =NULL ;
@@ -287,7 +289,7 @@ static int __init l4_add_card(int card_no)if (result)return result; -printk (KERN_INFO "gameport: PDPI Lightning 4 %s card v%d.%d at %#x\n" , +pr_info ("PDPI Lightning 4 %s card v%d.%d at %#x\n" , card_no ?"secondary" :"primary" , rev >>4 , rev,L4_PORT );for (i =0 ; i <4 ; i++) {
drivers/input/gameport/ns558.c +5 -3
@@ -27,6 +27,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <asm/io.h> #include <linux/module.h>
@@ -142,7 +144,7 @@ static int ns558_isa_probe(int io) ns558 =kzalloc (sizeof (struct ns558 ),GFP_KERNEL ); port =gameport_allocate_port ();if (!ns558 || !port) { -printk (KERN_ERR "ns558: Memory allocation failed.\n" ); +pr_err ("Memory allocation failed\n" );release_region (io & (-1 << i), (1 << i));kfree (ns558);gameport_free_port (port);
@@ -201,7 +203,7 @@ static int ns558_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *did)struct gameport *port;if (!pnp_port_valid (dev,0 )) { -printk (KERN_WARNING "ns558: No i/o ports on a gameport? Weird\n" ); +pr_warning ("No i/o ports on a gameport? Weird\n" );return -ENODEV ; }
@@ -214,7 +216,7 @@ static int ns558_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *did) ns558 =kzalloc (sizeof (struct ns558 ),GFP_KERNEL ); port =gameport_allocate_port ();if (!ns558 || !port) { -printk (KERN_ERR "ns558: Memory allocation failed\n" ); +pr_err ("Memory allocation failed\n" );kfree (ns558);gameport_free_port (port);return -ENOMEM ;
drivers/input/input-polldev.c +3 -2
@@ -8,6 +8,8 @@* the Free Software Foundation. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/jiffies.h> #include <linux/slab.h> #include <linux/mutex.h>
@@ -33,8 +35,7 @@ static int input_polldev_start_workqueue(void)if (!polldev_users) { polldev_wq =create_singlethread_workqueue ("ipolldevd" );if (!polldev_wq) { -printk (KERN_ERR "input-polldev: failed to create " -"ipolldevd workqueue\n" ); +pr_err ("failed to create ipolldevd workqueue\n" ); retval = -ENOMEM ; goto out; }
drivers/input/input.c +11 -11
@@ -10,6 +10,8 @@* the Free Software Foundation. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/init.h> #include <linux/types.h> #include <linux/input.h>
@@ -1019,10 +1021,8 @@ static int input_attach_handler(struct input_dev *dev, struct input_handler *han error = handler->connect (handler, dev, id);if (error && error != -ENODEV ) -printk (KERN_ERR -"input: failed to attach handler %s to device %s, " -"error: %d\n" , - handler->name,kobject_name (&dev->dev.kobj), error); +pr_err ("failed to attach handler %s to device %s, error: %d\n" , + handler->name,kobject_name (&dev->dev.kobj), error);return error; }
@@ -1852,9 +1852,8 @@ void input_set_capability(struct input_dev *dev, unsigned int type, unsigned intbreak ;default : -printk (KERN_ERR -"input_set_capability: unknown type %u (code %u)\n" , - type, code); +pr_err ("input_set_capability: unknown type %u (code %u)\n" , + type, code);dump_stack ();return ; }
@@ -1942,8 +1941,9 @@ int input_register_device(struct input_dev *dev)return error; path =kobject_get_path (&dev->dev.kobj,GFP_KERNEL ); -printk (KERN_INFO "input: %s as %s\n" , - dev->name ? dev->name :"Unspecified device" , path ? path :"N/A" ); +pr_info ("%s as %s\n" , + dev->name ? dev->name :"Unspecified device" , + path ? path :"N/A" );kfree (path); error =mutex_lock_interruptible (&input_mutex);
@@ -2224,7 +2224,7 @@ static int __init input_init(void) err =class_register (&input_class);if (err) { -printk (KERN_ERR "input: unable to register input_dev class\n" ); +pr_err ("unable to register input_dev class\n" );return err; }
@@ -2234,7 +2234,7 @@ static int __init input_init(void) err =register_chrdev (INPUT_MAJOR ,"input" , &input_fops);if (err) { -printk (KERN_ERR "input: unable to register char major %d" ,INPUT_MAJOR ); +pr_err ("unable to register char major %d" ,INPUT_MAJOR ); goto fail2; }
drivers/input/joydev.c +3 -1
@@ -10,6 +10,8 @@* (at your option) any later version. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <asm/io.h> #include <asm/system.h> #include <linux/delay.h>
@@ -803,7 +805,7 @@ static int joydev_connect(struct input_handler *handler, struct input_dev *dev,break ;if (minor ==JOYDEV_MINORS ) { -printk (KERN_ERR "joydev: no more free joydev devices\n" ); +pr_err ("no more free joydev devices\n" );return -ENFILE ; }
drivers/input/joystick/a3d.c +6 -3
@@ -26,6 +26,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/module.h> #include <linux/slab.h>
@@ -295,8 +297,9 @@ static int a3d_connect(struct gameport *gameport, struct gameport_driver *drv) a3d->mode = data[0 ];if (!a3d->mode || a3d->mode >5 ) { -printk (KERN_WARNING "a3d.c: Unknown A3D device detected " -"(%s, id=%d), contact <[email protected]>\n" , gameport->phys, a3d->mode); +pr_warning ("Unknown A3D device detected " +"(%s, id=%d), contact <[email protected]>\n" , + gameport->phys, a3d->mode); err = -ENODEV ; goto fail2; }
@@ -359,7 +362,7 @@ static int a3d_connect(struct gameport *gameport, struct gameport_driver *drv)a3d_read (a3d, data);if (!(a3d->adc = adc =gameport_allocate_port ())) -printk (KERN_ERR "a3d: Not enough memory for ADC port\n" ); +pr_err ("Not enough memory for ADC port\n" );else { adc->port_data = a3d; adc->open = a3d_adc_open;
drivers/input/joystick/adi.c +8 -4
@@ -26,6 +26,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/delay.h> #include <linux/kernel.h> #include <linux/module.h>
@@ -336,7 +338,8 @@ static void adi_id_decode(struct adi *adi, struct adi_port *port)return ;if (adi->ret < (t =adi_get_bits (adi,10 ))) { -printk (KERN_WARNING "adi: Short ID packet: reported: %d != read: %d\n" , t, adi->ret); +pr_warning ("Short ID packet: reported: %d != read: %d\n" , + t, adi->ret);return ; }
@@ -347,7 +350,7 @@ static void adi_id_decode(struct adi *adi, struct adi_port *port) adi->length =adi_get_bits (adi,10 );if (adi->length >=ADI_MAX_LENGTH || adi->length <ADI_MIN_LENGTH ) { -printk (KERN_WARNING "adi: Bad data packet length (%d).\n" , adi->length); +pr_warning ("Bad data packet length (%d)\n" , adi->length); adi->length =0 ;return ; }
@@ -356,7 +359,7 @@ static void adi_id_decode(struct adi *adi, struct adi_port *port) adi->buttons =adi_get_bits (adi,6 );if (adi_get_bits (adi,6 ) !=8 && adi->hats) { -printk (KERN_WARNING "adi: Other than 8-dir POVs not supported yet.\n" ); +pr_warning ("Other than 8-dir POVs not supported yet\n" ); adi->length =0 ;return ; }
@@ -379,7 +382,8 @@ static void adi_id_decode(struct adi *adi, struct adi_port *port) t =8 + adi->buttons + adi->axes10 *10 + adi->axes8 *8 + adi->hats *4 ;if (adi->length != t && adi->length != t + (t &1 )) { -printk (KERN_WARNING "adi: Expected length %d != data length %d\n" , t, adi->length); +pr_warning ("Expected length %d != data length %d\n" , + t, adi->length); adi->length =0 ;return ; }
drivers/input/joystick/amijoy.c +3 -1
@@ -26,6 +26,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/types.h> #include <linux/errno.h> #include <linux/kernel.h>
@@ -84,7 +86,7 @@ static int amijoy_open(struct input_dev *dev)return err;if (!amijoy_used &&request_irq (IRQ_AMIGA_VERTB , amijoy_interrupt,0 ,"amijoy" , amijoy_interrupt)) { -printk (KERN_ERR "amijoy.c: Can't allocate irq %d\n" ,IRQ_AMIGA_VERTB ); +pr_err ("Can't allocate irq %d\n" ,IRQ_AMIGA_VERTB ); err = -EBUSY ; goto out; }
drivers/input/joystick/analog.c +9 -6
@@ -26,6 +26,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/delay.h> #include <linux/kernel.h> #include <linux/module.h>
@@ -531,9 +533,9 @@ static int analog_init_masks(struct analog_port *port)return -1 ;if ((port->mask &3 ) !=3 && port->mask !=0xc ) { -printk (KERN_WARNING "analog.c: Unknown joystick device found " -"(data=%#x, %s), probably not analog joystick.\n" , - port->mask, port->gameport->phys); +pr_warning ("Unknown joystick device found " +"(data=%#x, %s), probably not analog joystick\n" , + port->mask, port->gameport->phys);return -1 ; }
@@ -693,8 +695,9 @@ static void analog_disconnect(struct gameport *gameport)input_unregister_device (port->analog[i].dev);gameport_close (gameport);gameport_set_drvdata (gameport,NULL ); -printk (KERN_INFO "analog.c: %d out of %d reads (%d%%) on %s failed\n" , - port->bads, port->reads, port->reads ? (port->bads *100 / port->reads) :0 , +pr_info ("%d out of %d reads (%d%%) on %s failed\n" , + port->bads, port->reads, + port->reads ? (port->bads *100 / port->reads) :0 , port->gameport->phys);kfree (port); }
@@ -738,7 +741,7 @@ static void analog_parse_options(void) analog_options[i] =0xff ;if (!strlen (js[i]))continue ; -printk (KERN_WARNING "analog.c: Bad config for port %d - \"%s\"\n" , i, js[i]); +pr_warning ("Bad config for port %d - \"%s\"\n" , i, js[i]); }for (; i <ANALOG_PORTS ; i++)
drivers/input/joystick/cobra.c +5 -2
@@ -26,6 +26,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/module.h> #include <linux/slab.h>
@@ -177,8 +179,9 @@ static int cobra_connect(struct gameport *gameport, struct gameport_driver *drv)for (i =0 ; i <2 ; i++)if ((cobra->exists >> i) & data[i] &1 ) { -printk (KERN_WARNING "cobra.c: Device %d on %s has the Ext bit set. ID is: %d" -" Contact [email protected]\n" , i, gameport->phys, (data[i] >>2 ) &7 ); +pr_warning ("Device %d on %s has the Ext bit set. ID is: %d" +" Contact [email protected]\n" , + i, gameport->phys, (data[i] >>2 ) &7 ); cobra->exists &= ~(1 << i); }
drivers/input/joystick/db9.c +9 -7
@@ -29,6 +29,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/module.h> #include <linux/delay.h>
@@ -564,7 +566,7 @@ static struct db9 __init *db9_probe(int parport, int mode)int err;if (mode <1 || mode >=DB9_MAX_PAD || !db9_modes[mode].n_buttons) { -printk (KERN_ERR "db9.c: Bad device type %d\n" , mode); +pr_err ("Bad device type %d\n" , mode); err = -EINVAL ; goto err_out; }
@@ -573,27 +575,27 @@ static struct db9 __init *db9_probe(int parport, int mode) pp =parport_find_number (parport);if (!pp) { -printk (KERN_ERR "db9.c: no such parport\n" ); +pr_err ("no such parport\n" ); err = -ENODEV ; goto err_out; }if (db9_mode->bidirectional && !(pp->modes &PARPORT_MODE_TRISTATE )) { -printk (KERN_ERR "db9.c: specified parport is not bidirectional\n" ); +pr_err ("specified parport is not bidirectional\n" ); err = -EINVAL ; goto err_put_pp; } pd =parport_register_device (pp,"db9" ,NULL ,NULL ,NULL ,PARPORT_DEV_EXCL ,NULL );if (!pd) { -printk (KERN_ERR "db9.c: parport busy already - lp.o loaded?\n" ); +pr_err ("parport busy already - lp.o loaded?\n" ); err = -EBUSY ; goto err_put_pp; } db9 =kzalloc (sizeof (struct db9 ),GFP_KERNEL );if (!db9) { -printk (KERN_ERR "db9.c: Not enough memory\n" ); +pr_err ("Not enough memory\n" ); err = -ENOMEM ; goto err_unreg_pardev; }
@@ -609,7 +611,7 @@ static struct db9 __init *db9_probe(int parport, int mode) db9->dev[i] = input_dev =input_allocate_device ();if (!input_dev) { -printk (KERN_ERR "db9.c: Not enough memory for input device\n" ); +pr_err ("Not enough memory for input device\n" ); err = -ENOMEM ; goto err_unreg_devs; }
@@ -682,7 +684,7 @@ static int __init db9_init(void)continue ;if (db9_cfg[i].nargs <2 ) { -printk (KERN_ERR "db9.c: Device type must be specified.\n" ); +pr_err ("Device type must be specified\n" ); err = -EINVAL ;break ; }
drivers/input/joystick/gf2k.c +5 -2
@@ -26,6 +26,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/delay.h> #include <linux/kernel.h> #include <linux/slab.h>
@@ -287,8 +289,9 @@ static int gf2k_connect(struct gameport *gameport, struct gameport_driver *drv)#endif if (gf2k->id >GF2K_ID_MAX || !gf2k_axes[gf2k->id]) { -printk (KERN_WARNING "gf2k.c: Not yet supported joystick on %s. [id: %d type:%s]\n" , - gameport->phys, gf2k->id, gf2k->id >GF2K_ID_MAX ?"Unknown" : gf2k_names[gf2k->id]); +pr_warning ("Not yet supported joystick on %s. [id: %d type:%s]\n" , + gameport->phys, gf2k->id, + gf2k->id >GF2K_ID_MAX ?"Unknown" : gf2k_names[gf2k->id]); err = -ENODEV ; goto fail2; }
drivers/input/joystick/grip_mp.c +9 -6
@@ -9,6 +9,8 @@* Copyright (c) 1998-2000 Vojtech Pavlik */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h>
@@ -26,9 +28,9 @@ MODULE_DESCRIPTION(DRIVER_DESC);MODULE_LICENSE ("GPL" );#ifdef GRIP_DEBUG -#define dbg(format, arg...) printk(KERN_ERR __FILE__ ": " format "\n" , ## arg) +#define dbg(format, arg...) pr_err(format "\n", ##arg)#else -#define dbg(format, arg...) do {} while (0) +#define dbg(format, arg...) do { if (0) pr_err(format "\n", ##arg); } while (0)#endif #define GRIP_MAX_PORTS 4
@@ -393,8 +395,8 @@ static int get_and_decode_packet(struct grip_mp *grip, int flags)if (!joytype) {if (port->registered) { -printk (KERN_INFO "grip_mp: removing %s, slot %d\n" , - grip_name[port->mode], slot); +pr_info ("removing %s, slot %d\n" , + grip_name[port->mode], slot);input_unregister_device (port->dev); port->registered =0 ; }
@@ -434,8 +436,9 @@ static int get_and_decode_packet(struct grip_mp *grip, int flags) {static int strange_code =0 ;if (strange_code != joytype) { -printk (KERN_INFO "Possible non-grip pad/joystick detected.\n" ); -printk (KERN_INFO "Got joy type 0x%x and packet 0x%x.\n" , joytype, packet); +pr_info ("Possible non-grip pad/joystick detected\n" ); +pr_info ("Got joy type 0x%x and packet 0x%x\n" , + joytype, packet); strange_code = joytype; } }
drivers/input/joystick/guillemot.c +8 -3
@@ -26,6 +26,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/slab.h> #include <linux/module.h>
@@ -211,8 +213,10 @@ static int guillemot_connect(struct gameport *gameport, struct gameport_driver *break ;if (!guillemot_type[i].name) { -printk (KERN_WARNING "guillemot.c: Unknown joystick on %s. [ %02x%02x:%04x, ver %d.%02d ]\n" , - gameport->phys, data[12 ], data[13 ], data[11 ], data[14 ], data[15 ]); +pr_warning ("Unknown joystick on %s. " +"[ %02x%02x:%04x, ver %d.%02d ]\n" , + gameport->phys, + data[12 ], data[13 ], data[11 ], data[14 ], data[15 ]); err = -ENODEV ; goto fail2; }
@@ -266,7 +270,8 @@ static void guillemot_disconnect(struct gameport *gameport) {struct guillemot *guillemot =gameport_get_drvdata (gameport); -printk (KERN_INFO "guillemot.c: Failed %d reads out of %d on %s\n" , guillemot->reads, guillemot->bads, guillemot->phys); +pr_info ("Failed %d reads out of %d on %s\n" , + guillemot->reads, guillemot->bads, guillemot->phys);input_unregister_device (guillemot->dev);gameport_close (gameport);kfree (guillemot);
drivers/input/joystick/iforce/iforce-packets.c +5 -3
@@ -25,6 +25,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include "iforce.h" static struct {
@@ -37,10 +39,10 @@ void iforce_dump_packet(char *msg, u16 cmd, unsigned char *data) {int i; - printk(KERN_DEBUG __FILE__ ": %s cmd = %04x, data = ", msg, cmd); + printk(KERN_DEBUG pr_fmt("%s cmd = %04x, data ="), msg, cmd);for (i =0 ; i <LO (cmd); i++) -printk ("%02x " , data[i]); -printk ("\n" ); +pr_cont (" %02x" , data[i]); +pr_cont ("\n" ); }/*
drivers/input/joystick/interact.c +5 -2
@@ -29,6 +29,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/slab.h> #include <linux/module.h>
@@ -240,8 +242,9 @@ static int interact_connect(struct gameport *gameport, struct gameport_driver *dbreak ;if (!interact_type[i].length) { -printk (KERN_WARNING "interact.c: Unknown joystick on %s. [len %d d0 %08x d1 %08x i2 %08x]\n" , - gameport->phys, i, data[0 ], data[1 ], data[2 ]); +pr_warning ("Unknown joystick on %s. " +"[len %d d0 %08x d1 %08x i2 %08x]\n" , + gameport->phys, i, data[0 ], data[1 ], data[2 ]); err = -ENODEV ; goto fail2; }
drivers/input/joystick/joydump.c +22 -18
@@ -27,6 +27,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/gameport.h> #include <linux/kernel.h>
@@ -56,34 +58,36 @@ static int joydump_connect(struct gameport *gameport, struct gameport_driver *drunsigned long flags;unsigned char u; -printk (KERN_INFO "joydump: ,------------------ START ----------------.\n" ); -printk (KERN_INFO "joydump: | Dumping: %30s |\n" , gameport->phys); -printk (KERN_INFO "joydump: | Speed: %28d kHz |\n" , gameport->speed); +pr_info (",------------------ START ----------------.\n" ); +pr_info ("| Dumping: %30s |\n" , gameport->phys); +pr_info ("| Speed: %28d kHz |\n" , gameport->speed);if (gameport_open (gameport, drv,GAMEPORT_MODE_RAW )) { -printk (KERN_INFO "joydump: | Raw mode not available - trying cooked. |\n" ); +pr_info ("| Raw mode not available - trying cooked. |\n" );if (gameport_open (gameport, drv,GAMEPORT_MODE_COOKED )) { -printk (KERN_INFO "joydump: | Cooked not available either. Failing. |\n" ); -printk (KERN_INFO "joydump: `------------------- END -----------------'\n" ); +pr_info ("| Cooked not available either. Failing. |\n" ); +pr_info ("`------------------- END -----------------'\n" );return -ENODEV ; }gameport_cooked_read (gameport, axes, &buttons);for (i =0 ; i <4 ; i++) -printk (KERN_INFO "joydump: | Axis %d: %4d. |\n" , i, axes[i]); -printk (KERN_INFO "joydump: | Buttons %02x. |\n" , buttons); -printk (KERN_INFO "joydump: `------------------- END -----------------'\n" ); +pr_info ("| Axis %d: %4d. |\n" , + i, axes[i]); +pr_info ("| Buttons %02x. |\n" , + buttons); +pr_info ("`------------------- END -----------------'\n" ); } timeout =gameport_time (gameport,10000 );/* 10 ms */ buf =kmalloc (BUF_SIZE *sizeof (struct joydump ),GFP_KERNEL );if (!buf) { -printk (KERN_INFO "joydump: no memory for testing\n" ); +pr_info ("no memory for testing\n" ); goto jd_end; } dump = buf;
@@ -123,24 +127,24 @@ static int joydump_connect(struct gameport *gameport, struct gameport_driver *dr dump = buf; prev = dump; -printk (KERN_INFO "joydump: >------------------ DATA -----------------<\n" ); -printk (KERN_INFO "joydump: | index: %3d delta: %3d us data: " ,0 ,0 ); +pr_info (">------------------ DATA -----------------<\n" ); +pr_info ("| index: %3d delta: %3d us data: " ,0 ,0 );for (j =7 ; j >=0 ; j--) -printk ("%d" , (dump->data >> j) &1 ); -printk (" |\n" ); +pr_cont ("%d" , (dump->data >> j) &1 ); +pr_cont (" |\n" ); dump++;for (i =1 ; i < t; i++, dump++, prev++) { -printk (KERN_INFO "joydump: | index: %3d delta: %3d us data: " , +pr_info ("| index: %3d delta: %3d us data: " , i, dump->time - prev->time);for (j =7 ; j >=0 ; j--) -printk ("%d" , (dump->data >> j) &1 ); -printk (" |\n" ); +pr_cont ("%d" , (dump->data >> j) &1 ); +pr_cont (" |\n" ); }kfree (buf); jd_end: -printk (KERN_INFO "joydump: `------------------- END -----------------'\n" ); +pr_info ("`------------------- END -----------------'\n" );return 0 ; }
drivers/input/joystick/sidewinder.c +32 -26
159 lines not on this page · raw message
drivers/input/joystick/spaceball.c +4 -2
@@ -30,6 +30,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/slab.h> #include <linux/module.h>
@@ -128,12 +130,12 @@ static void spaceball_process_packet(struct spaceball* spaceball)case 'E' :/* Device error */ spaceball->data[spaceball->idx -1 ] =0 ; -printk (KERN_ERR "spaceball: Device error. [%s]\n" , spaceball->data +1 ); +pr_err ("Device error. [%s]\n" , spaceball->data +1 );break ;case '?' :/* Bad command packet */ spaceball->data[spaceball->idx -1 ] =0 ; -printk (KERN_ERR "spaceball: Bad command. [%s]\n" , spaceball->data +1 ); +pr_err ("Bad command. [%s]\n" , spaceball->data +1 );break ; }
drivers/input/joystick/spaceorb.c +10 -5
@@ -29,6 +29,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/slab.h> #include <linux/module.h>
@@ -89,8 +91,8 @@ static void spaceorb_process_packet(struct spaceorb *spaceorb)case 'R' :/* Reset packet */ spaceorb->data[spaceorb->idx -1 ] =0 ;for (i =1 ; i < spaceorb->idx && spaceorb->data[i] ==' ' ; i++); -printk (KERN_INFO "input: %s [%s] is %s\n" , - dev->name, spaceorb->data + i, spaceorb->phys); +pr_info ("%s [%s] is %s\n" , + dev->name, spaceorb->data + i, spaceorb->phys);break ;case 'D' :/* Ball + button data */
@@ -117,9 +119,12 @@ static void spaceorb_process_packet(struct spaceorb *spaceorb)case 'E' :/* Error packet */ if (spaceorb->idx !=4 )return ; -printk (KERN_ERR "spaceorb: Device error. [ " ); -for (i =0 ; i <7 ; i++)if (data[1 ] & (1 << i))printk ("%s " , spaceorb_errors[i]); -printk ("]\n" ); +pr_err ("Device error. [" ); +for (i =0 ; i <7 ; i++) { +if (data[1 ] & (1 << i)) +pr_cont (" %s" , spaceorb_errors[i]); + } +pr_cont (" ]\n" );break ; }
drivers/input/joystick/turbografx.c +9 -7
@@ -29,6 +29,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/parport.h> #include <linux/input.h>
@@ -167,21 +169,21 @@ static struct tgfx __init *tgfx_probe(int parport, int *n_buttons, int n_devs) pp =parport_find_number (parport);if (!pp) { -printk (KERN_ERR "turbografx.c: no such parport\n" ); +pr_err ("no such parport\n" ); err = -EINVAL ; goto err_out; } pd =parport_register_device (pp,"turbografx" ,NULL ,NULL ,NULL ,PARPORT_DEV_EXCL ,NULL );if (!pd) { -printk (KERN_ERR "turbografx.c: parport busy already - lp.o loaded?\n" ); +pr_err ("parport busy already - lp.o loaded?\n" ); err = -EBUSY ; goto err_put_pp; } tgfx =kzalloc (sizeof (struct tgfx ),GFP_KERNEL );if (!tgfx) { -printk (KERN_ERR "turbografx.c: Not enough memory\n" ); +pr_err ("Not enough memory\n" ); err = -ENOMEM ; goto err_unreg_pardev; }
@@ -197,14 +199,14 @@ static struct tgfx __init *tgfx_probe(int parport, int *n_buttons, int n_devs)continue ;if (n_buttons[i] >6 ) { -printk (KERN_ERR "turbografx.c: Invalid number of buttons %d\n" , n_buttons[i]); +pr_err ("Invalid number of buttons %d\n" , n_buttons[i]); err = -EINVAL ; goto err_unreg_devs; } tgfx->dev[i] = input_dev =input_allocate_device ();if (!input_dev) { -printk (KERN_ERR "turbografx.c: Not enough memory for input device\n" ); +pr_err ("Not enough memory for input device\n" ); err = -ENOMEM ; goto err_unreg_devs; }
@@ -240,7 +242,7 @@ static struct tgfx __init *tgfx_probe(int parport, int *n_buttons, int n_devs) }if (!tgfx->sticks) { -printk (KERN_ERR "turbografx.c: No valid devices specified\n" ); +pr_err ("No valid devices specified\n" ); err = -EINVAL ; goto err_free_tgfx; }
@@ -285,7 +287,7 @@ static int __init tgfx_init(void)continue ;if (tgfx_cfg[i].nargs <2 ) { -printk (KERN_ERR "turbografx.c: at least one joystick must be specified\n" ); +pr_err ("at least one joystick must be specified\n" ); err = -EINVAL ;break ; }
drivers/input/joystick/walkera0701.c +4 -2
@@ -12,6 +12,8 @@* the Free Software Foundation. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +/* #define WK0701_DEBUG */ #define RESERVE 20000
@@ -108,7 +110,7 @@ static inline void walkera0701_parse_frame(struct walkera_dev *w) magic = (w->buf[21 ] <<4 ) | w->buf[22 ]; magic_bit = (w->buf[24 ] &8 ) >>3 ; printk(KERN_DEBUG -"walkera0701: %4d %4d %4d %4d %4d %4d %4d %4d (magic %2x %d)\n" , + pr_fmt("%4d %4d %4d %4d %4d %4d %4d %4d (magic %2x %d)\n"), val1, val2, val3, val4, val5, val6, val7, val8, magic, magic_bit); }
@@ -207,7 +209,7 @@ static int walkera0701_connect(struct walkera_dev *w, int parport)return -ENODEV ;if (w->parport->irq ==-1 ) { -printk (KERN_ERR "walkera0701: parport without interrupt\n" ); +pr_err ("parport without interrupt\n" ); goto init_err; }
drivers/input/joystick/xpad.c +3 -1
@@ -73,6 +73,8 @@* Later changes can be tracked in SCM. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/init.h> #include <linux/slab.h>
@@ -1001,7 +1003,7 @@ static int __init usb_xpad_init(void) {int result =usb_register (&xpad_driver);if (result ==0 ) - printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_DESC "\n"); +pr_info (DRIVER_DESC "\n" );return result; }
drivers/input/keyboard/amikbd.c +29 -13
60 lines not on this page · raw message
drivers/input/keyboard/atakbd.c +3 -1
@@ -40,6 +40,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/init.h> #include <linux/input.h>
@@ -210,7 +212,7 @@ static void atakbd_interrupt(unsigned char scancode, char down)input_sync (atakbd_dev); } }else /* scancodes >= 0xf2 are mouse data, most likely */ -printk (KERN_INFO "atakbd: unhandled scancode %x\n" , scancode); +pr_info ("unhandled scancode %x\n" , scancode);return ; }
drivers/input/keyboard/hil_kbd.c +9 -12
@@ -31,6 +31,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/hil.h> #include <linux/input.h> #include <linux/serio.h>
@@ -131,7 +133,7 @@ static void hil_dev_handle_command_response(struct hil_dev *dev)/* These occur when device isn't present */ if (p != (HIL_ERR_INT |HIL_PKT_CMD )) {/* Anything else we'd like to know about. */ - printk(KERN_WARNING PREFIX "Device sent unknown record %x\n", p); +pr_warning ("Device sent unknown record %x\n" , p); } goto out; }
@@ -212,8 +214,7 @@ static void hil_dev_handle_ptr_events(struct hil_dev *ptr)bool absdev, ax16;if ((p &HIL_CMDCT_POL ) != idx -1 ) { - printk(KERN_WARNING PREFIX - "Malformed poll packet %x (idx = %i)\n", p, idx); +pr_warning ("Malformed poll packet %x (idx = %i)\n" , p, idx);return ; }
@@ -266,7 +267,7 @@ static void hil_dev_handle_ptr_events(struct hil_dev *ptr)static void hil_dev_process_err (struct hil_dev *dev) { - printk(KERN_WARNING PREFIX "errored HIL packet\n"); +pr_warning ("errored HIL packet\n" ); dev->idx4 =0 ;complete (&dev->cmd_done);/* just in case somebody is waiting */ }
@@ -346,7 +347,7 @@ static void hil_dev_keyboard_setup(struct hil_dev *kbd) input_dev->name =strlen (kbd->rnm) ? kbd->rnm :"HIL keyboard" ; input_dev->phys ="hpkbd/input0" ; - printk(KERN_INFO PREFIX "HIL keyboard found (did = 0x%02x, lang = %s)\n", +pr_info ("HIL keyboard found (did = 0x%02x, lang = %s)\n" , did, hil_language[did &HIL_IDD_DID_TYPE_KB_LANG_MASK ]); }
@@ -430,11 +431,8 @@ static void hil_dev_pointer_setup(struct hil_dev *ptr) input_dev->name =strlen (ptr->rnm) ? ptr->rnm :"HIL pointer device" ; - printk(KERN_INFO PREFIX -"HIL pointer device found (did: 0x%02x, axis: %s)\n" , - did, txt); - printk(KERN_INFO PREFIX -"HIL pointer has %i buttons and %i sets of %i axes\n" , +pr_info ("HIL pointer device found (did: 0x%02x, axis: %s)\n" , did, txt); +pr_info ("HIL pointer has %i buttons and %i sets of %i axes\n" , ptr->nbtn, naxsets, ptr->naxes); }
@@ -508,8 +506,7 @@ static int hil_dev_connect(struct serio *serio, struct serio_driver *drv)case HIL_IDD_DID_TYPE_CHAR :if (HIL_IDD_NUM_BUTTONS (idd) ||HIL_IDD_NUM_AXES_PER_SET (*idd)) { - printk(KERN_INFO PREFIX - "combo devices are not supported.\n"); +pr_info ("combo devices are not supported\n" ); goto bail1; }
drivers/input/keyboard/hilkbd.c +14 -12
@@ -15,6 +15,8 @@* archive for more details. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/pci_ids.h> #include <linux/ioport.h> #include <linux/module.h>
@@ -219,7 +221,7 @@ static int __devinit hil_keyb_init(void) err =request_irq (HIL_IRQ , hil_interrupt,0 ,"hil" , hil_dev.dev_id);if (err) { -printk (KERN_ERR "HIL: Can't get IRQ\n" ); +pr_err ("Can't get IRQ\n" ); goto err1; }
@@ -232,16 +234,16 @@ static int __devinit hil_keyb_init(void)wait_event_interruptible_timeout (hil_wait, hil_dev.valid,3 *HZ );if (!hil_dev.valid) -printk (KERN_WARNING "HIL: timed out, assuming no keyboard present\n" ); +pr_warning ("timed out, assuming no keyboard present\n" ); c = hil_dev.c; hil_dev.valid =0 ;if (c ==0 ) { kbid =-1 ; -printk (KERN_WARNING "HIL: no keyboard present\n" ); +pr_warning ("no keyboard present\n" ); }else { kbid =ffz (~c); -printk (KERN_INFO "HIL: keyboard found at id %d\n" , kbid); +pr_info ("keyboard found at id %d\n" , kbid); }/* set it to raw mode */
@@ -268,12 +270,12 @@ static int __devinit hil_keyb_init(void) err =input_register_device (hil_dev.dev);if (err) { -printk (KERN_ERR "HIL: Can't register device\n" ); +pr_err ("Can't register device\n" ); goto err2; } -printk (KERN_INFO "input: %s, ID %d at 0x%08lx (irq %d) found and attached\n" , - hil_dev.dev->name, kbid,HILBASE ,HIL_IRQ ); +pr_info ("%s, ID %d at 0x%08lx (irq %d) found and attached\n" , + hil_dev.dev->name, kbid,HILBASE ,HIL_IRQ );return 0 ;
@@ -306,8 +308,8 @@ static int __devinit hil_probe_chip(struct parisc_device *dev)return -ENODEV ;if (!dev->irq) { -printk (KERN_WARNING "HIL: IRQ not found for HIL bus at 0x%p\n" , - (void *)dev->hpa.start); +pr_warning ("IRQ not found for HIL bus at 0x%p\n" , + (void *)dev->hpa.start);return -ENODEV ; }
@@ -315,7 +317,7 @@ static int __devinit hil_probe_chip(struct parisc_device *dev) hil_irq = dev->irq; hil_dev.dev_id = dev; -printk (KERN_INFO "Found HIL bus at 0x%08lx, IRQ %d\n" , hil_base, hil_irq); +pr_info ("Found HIL bus at 0x%08lx, IRQ %d\n" , hil_base, hil_irq);return hil_keyb_init (); }
@@ -368,12 +370,12 @@ static int __init hil_init(void)return -ENODEV ;if (!hwreg_present ((void *)(HILBASE +HIL_DATA ))) { -printk (KERN_ERR "HIL: hardware register was not found\n" ); +pr_err ("hardware register was not found\n" );return -ENODEV ; }if (!request_region (HILBASE +HIL_DATA ,2 ,"hil" )) { -printk (KERN_ERR "HIL: IOPORT region already used\n" ); +pr_err ("IOPORT region already used\n" );return -EIO ; }
drivers/input/keyboard/jornada680_kbd.c +3 -2
@@ -16,6 +16,8 @@* published by the Free Software Foundation. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/init.h> #include <linux/input.h> #include <linux/input-polldev.h>
@@ -231,8 +233,7 @@ static int __devinit jornada680kbd_probe(struct platform_device *pdev)return 0 ; failed: -printk (KERN_ERR "Jornadakbd: failed to register driver, error: %d\n" , - error); +pr_err ("failed to register driver, error: %d\n" , error);platform_set_drvdata (pdev,NULL );input_free_polled_device (poll_dev);kfree (jornadakbd);
drivers/input/keyboard/jornada720_kbd.c +6 -4
@@ -15,6 +15,9 @@* published by the Free Software Foundation. * */ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/device.h> #include <linux/errno.h> #include <linux/interrupt.h>
@@ -67,9 +70,8 @@ static irqreturn_t jornada720_kbd_interrupt(int irq, void *dev_id)if (jornada_ssp_inout (GETSCANKEYCODE ) !=TXDUMMY ) { printk(KERN_DEBUG -"jornada720_kbd: " -"GetKeycode command failed with ETIMEDOUT, " -"flushed bus\n" ); + pr_fmt("GetKeycode command failed with ETIMEDOUT, " + "flushed bus\n")); }else {/* How many keycodes are waiting for us? */ count =jornada_ssp_byte (TXDUMMY );
@@ -132,7 +134,7 @@ static int __devinit jornada720_kbd_probe(struct platform_device *pdev)IRQF_DISABLED |IRQF_TRIGGER_FALLING , "jornadakbd", pdev);if (err) { -printk (KERN_INFO "jornadakbd720_kbd: Unable to grab IRQ\n" ); +pr_info ("Unable to grab IRQ\n" ); goto fail1; }
drivers/input/keyboard/lkkbd.c +26 -28
129 lines not on this page · raw message
drivers/input/keyboard/locomokbd.c +4 -2
@@ -23,6 +23,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/slab.h> #include <linux/module.h> #include <linux/init.h>
@@ -254,7 +256,7 @@ static int __devinit locomokbd_probe(struct locomo_dev *dev) dev->length, LOCOMO_DRIVER_NAME(dev))) { err = -EBUSY ; -printk (KERN_ERR "locomokbd: Can't acquire access to io memory for keyboard\n" ); +pr_err ("Can't acquire access to io memory for keyboard\n" ); goto err_free_mem; }
@@ -299,7 +301,7 @@ static int __devinit locomokbd_probe(struct locomo_dev *dev)/* attempt to get the interrupt */ err =request_irq (dev->irq[0 ], locomokbd_interrupt,0 ,"locomokbd" , locomokbd);if (err) { -printk (KERN_ERR "locomokbd: Can't get irq for keyboard\n" ); +pr_err ("Can't get irq for keyboard\n" ); goto err_release_region; }
drivers/input/keyboard/newtonkbd.c +3 -1
@@ -26,6 +26,8 @@* Justin Cormack, 68 Dartmouth Park Road, London NW5 1SN, UK. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/slab.h> #include <linux/module.h> #include <linux/input.h>
@@ -76,7 +78,7 @@ static irqreturn_t nkbd_interrupt(struct serio *serio, }else if (data ==0xe7 )/* end of init sequence */ -printk (KERN_INFO "input: %s on %s\n" , nkbd->dev->name, serio->phys); +pr_info ("%s on %s\n" , nkbd->dev->name, serio->phys);return IRQ_HANDLED ; }
drivers/input/keyboard/omap-keypad.c +12 -13
@@ -24,6 +24,8 @@* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/init.h> #include <linux/interrupt.h>
@@ -195,15 +197,14 @@ static void omap_kp_tasklet(unsigned long data)if (!(changed & (1 << row)))continue ;#ifdef NEW_BOARD_LEARNING_MODE -printk (KERN_INFO "omap-keypad: key %d-%d %s\n" , col, - row, (new_state[col] & (1 << row)) ? -"pressed" :"released" ); +pr_info ("key %d-%d %s\n" , + col, row, (new_state[col] & (1 << row)) ? +"pressed" :"released" );#else key =omap_kp_find_key (col, row);if (key <0 ) { -printk (KERN_WARNING -"omap-keypad: Spurious key event %d-%d\n" , - col, row); +pr_warning ("Spurious key event %d-%d\n" , + col, row);/* We scan again after a couple of seconds */ spurious =1 ;continue ;
@@ -300,7 +301,7 @@ static int __devinit omap_kp_probe(struct platform_device *pdev)int i, col_idx, row_idx, irq_idx, ret;if (!pdata->rows || !pdata->cols || !pdata->keymap) { -printk (KERN_ERR "No rows, cols or keymap from pdata\n" ); +pr_err ("No rows, cols or keymap from pdata\n" );return -EINVAL ; }
@@ -340,8 +341,7 @@ static int __devinit omap_kp_probe(struct platform_device *pdev)/* Cols: outputs */ for (col_idx =0 ; col_idx < omap_kp->cols; col_idx++) {if (gpio_request (col_gpios[col_idx],"omap_kp_col" ) <0 ) { -printk (KERN_ERR "Failed to request" -"GPIO%d for keypad\n" , +pr_err ("Failed to request GPIO%d for keypad\n" , col_gpios[col_idx]); goto err1; }
@@ -350,8 +350,7 @@ static int __devinit omap_kp_probe(struct platform_device *pdev)/* Rows: inputs */ for (row_idx =0 ; row_idx < omap_kp->rows; row_idx++) {if (gpio_request (row_gpios[row_idx],"omap_kp_row" ) <0 ) { -printk (KERN_ERR "Failed to request" -"GPIO%d for keypad\n" , +pr_err ("Failed to request GPIO%d for keypad\n" , row_gpios[row_idx]); goto err2; }
@@ -387,7 +386,7 @@ static int __devinit omap_kp_probe(struct platform_device *pdev) ret =input_register_device (omap_kp->input);if (ret <0 ) { -printk (KERN_ERR "Unable to register omap-keypad input device\n" ); +pr_err ("Unable to register omap-keypad input device\n" ); goto err3; }
@@ -478,7 +477,7 @@ static struct platform_driver omap_kp_driver = {static int __init omap_kp_init (void ) { -printk (KERN_INFO "OMAP Keypad Driver\n" ); +pr_info ("OMAP Keypad Driver\n" );return platform_driver_register (&omap_kp_driver); }
drivers/input/keyboard/sunkbd.c +5 -4
@@ -26,6 +26,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/delay.h> #include <linux/sched.h> #include <linux/slab.h>
@@ -137,10 +139,9 @@ static irqreturn_t sunkbd_interrupt(struct serio *serio, !(data & SUNKBD_RELEASE));input_sync (sunkbd->dev); }else { -printk (KERN_WARNING -"sunkbd.c: Unknown key (scancode %#x) %s.\n" , - data &SUNKBD_KEY , - data &SUNKBD_RELEASE ?"released" :"pressed" ); +pr_warning ("Unknown key (scancode %#x) %s.\n" , + data &SUNKBD_KEY , + data &SUNKBD_RELEASE ?"released" :"pressed" ); } } out:
drivers/input/keyboard/xtkbd.c +5 -2
@@ -26,6 +26,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/slab.h> #include <linux/module.h> #include <linux/input.h>
@@ -76,8 +78,9 @@ static irqreturn_t xtkbd_interrupt(struct serio *serio,input_report_key (xtkbd->dev, xtkbd->keycode[data &XTKBD_KEY ], !(data &XTKBD_RELEASE ));input_sync (xtkbd->dev); }else { -printk (KERN_WARNING "xtkbd.c: Unknown key (scancode %#x) %s.\n" , - data &XTKBD_KEY , data &XTKBD_RELEASE ?"released" :"pressed" ); +pr_warning ("Unknown key (scancode %#x) %s\n" , + data &XTKBD_KEY , + data &XTKBD_RELEASE ?"released" :"pressed" ); } }return IRQ_HANDLED ;
drivers/input/misc/ati_remote.c +12 -10
@@ -85,6 +85,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h>
@@ -139,9 +141,11 @@ static int repeat_delay = REPEAT_DELAY;module_param (repeat_delay, int,0644 );MODULE_PARM_DESC (repeat_delay,"Delay before sending repeats, default = 500 msec" ); -#define dbginfo(dev, format, arg...) do { if (debug) dev_info(dev , format , ## arg); } while (0) -#undef err -#define err(format, arg...) printk(KERN_ERR format , ## arg) +#define dbginfo(dev, format, arg...) \ +do { \ + if (debug) \ + dev_info(dev, format, ##arg); \ +} while (0)static struct usb_device_id ati_remote_table[] = { {USB_DEVICE (ATI_REMOTE_VENDOR_ID ,LOLA_REMOTE_PRODUCT_ID ) },
@@ -738,7 +742,7 @@ static int ati_remote_probe(struct usb_interface *interface, const struct usb_deint err = -ENOMEM ;if (iface_host->desc.bNumEndpoints !=2 ) { -err ("%s: Unexpected desc.bNumEndpoints\n" , __func__); +pr_err ("%s: Unexpected desc.bNumEndpoints\n" , __func__);return -ENODEV ; }
@@ -746,11 +750,11 @@ static int ati_remote_probe(struct usb_interface *interface, const struct usb_de endpoint_out = &iface_host->endpoint[1 ].desc;if (!usb_endpoint_is_int_in (endpoint_in)) { -err ("%s: Unexpected endpoint_in\n" , __func__); +pr_err ("%s: Unexpected endpoint_in\n" , __func__);return -ENODEV ; }if (le16_to_cpu (endpoint_in->wMaxPacketSize) ==0 ) { -err ("%s: endpoint_in message size==0? \n" , __func__); +pr_err ("%s: endpoint_in message size==0?\n" , __func__);return -ENODEV ; }
@@ -838,11 +842,9 @@ static int __init ati_remote_init(void) result =usb_register (&ati_remote_driver);if (result) - printk(KERN_ERR KBUILD_MODNAME -": usb_register error #%d\n" , result); +pr_err ("usb_register error #%d\n" , result);else - printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" -DRIVER_DESC "\n" ); +pr_info (DRIVER_VERSION ":" DRIVER_DESC "\n" );return result; }
drivers/input/misc/ati_remote2.c +4 -2
@@ -9,6 +9,8 @@* as published by the Free Software Foundation. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/usb/input.h> #include <linux/slab.h>
@@ -975,9 +977,9 @@ static int __init ati_remote2_init(void) r =usb_register (&ati_remote2_driver);if (r) -printk (KERN_ERR "ati_remote2: usb_register() = %d\n" , r); +pr_err ("usb_register() = %d\n" , r);else -printk (KERN_INFO "ati_remote2: " DRIVER_DESC " " DRIVER_VERSION "\n" ); +pr_info (DRIVER_DESC " " DRIVER_VERSION "\n" );return r; }
drivers/input/misc/cm109.c +9 -14
@@ -28,6 +28,8 @@* - Read/write EEPROM */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/init.h> #include <linux/slab.h>
@@ -518,8 +520,7 @@ static int cm109_input_open(struct input_dev *idev) error =usb_autopm_get_interface (dev->intf);if (error <0 ) { -err ("%s - cannot autoresume, result %d" , - __func__, error); +err ("%s: cannot autoresume, result %d" , __func__, error);return error; }
@@ -855,23 +856,18 @@ static int __init cm109_select_keymap(void)/* Load the phone keymap */ if (!strcasecmp (phone,"kip1000" )) { keymap = keymap_kip1000; - printk(KERN_INFO KBUILD_MODNAME ": " - "Keymap for Komunikate KIP1000 phone loaded\n"); +pr_info ("Keymap for Komunikate KIP1000 phone loaded\n" ); }else if (!strcasecmp (phone,"gtalk" )) { keymap = keymap_gtalk; - printk(KERN_INFO KBUILD_MODNAME ": " - "Keymap for Genius G-talk phone loaded\n"); +pr_info ("Keymap for Genius G-talk phone loaded\n" ); }else if (!strcasecmp (phone,"usbph01" )) { keymap = keymap_usbph01; - printk(KERN_INFO KBUILD_MODNAME ": " - "Keymap for Allied-Telesis Corega USBPH01 phone loaded\n"); +pr_info ("Keymap for Allied-Telesis Corega USBPH01 phone loaded\n" ); }else if (!strcasecmp (phone,"atcom" )) { keymap = keymap_atcom; - printk(KERN_INFO KBUILD_MODNAME ": " - "Keymap for ATCom AU-100 phone loaded\n"); +pr_info ("Keymap for ATCom AU-100 phone loaded\n" ); }else { - printk(KERN_ERR KBUILD_MODNAME ": " - "Unsupported phone: %s\n", phone); +pr_err ("Unsupported phone: %s\n" , phone);return -EINVAL ; }
@@ -890,8 +886,7 @@ static int __init cm109_init(void)if (err)return err; - printk(KERN_INFO KBUILD_MODNAME ": " - DRIVER_DESC ": " DRIVER_VERSION " (C) " DRIVER_AUTHOR "\n"); +pr_info (DRIVER_DESC ": " DRIVER_VERSION " (C) " DRIVER_AUTHOR "\n" );return 0 ; }
drivers/input/misc/hp_sdc_rtc.c +6 -4
@@ -33,6 +33,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/hp_sdc.h> #include <linux/errno.h> #include <linux/types.h>
@@ -703,13 +705,13 @@ static int __init hp_sdc_rtc_init(void)if ((ret =hp_sdc_request_timer_irq (&hp_sdc_rtc_isr)))return ret;if (misc_register (&hp_sdc_rtc_dev) !=0 ) -printk (KERN_INFO "Could not register misc. dev for i8042 rtc\n" ); +pr_info ("Could not register misc. dev for i8042 rtc\n" );create_proc_read_entry ("driver/rtc" ,0 ,NULL , hp_sdc_rtc_read_proc,NULL ); -printk (KERN_INFO "HP i8042 SDC + MSM-58321 RTC support loaded " -"(RTC v " RTC_VERSION ")\n" ); +pr_info ("HP i8042 SDC + MSM-58321 RTC support loaded " +"(RTC v " RTC_VERSION ")\n" );return 0 ; }
@@ -719,7 +721,7 @@ static void __exit hp_sdc_rtc_exit(void)remove_proc_entry ("driver/rtc" ,NULL );misc_deregister (&hp_sdc_rtc_dev);hp_sdc_release_timer_irq (hp_sdc_rtc_isr); -printk (KERN_INFO "HP i8042 SDC + MSM-58321 RTC support unloaded\n" ); +pr_info ("HP i8042 SDC + MSM-58321 RTC support unloaded\n" ); }module_init (hp_sdc_rtc_init);
drivers/input/misc/m68kspkr.c +3 -1
@@ -13,6 +13,8 @@* the Free Software Foundation */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h>
@@ -113,7 +115,7 @@ static int __init m68kspkr_init(void)int err;if (!mach_beep) { -printk (KERN_INFO "m68kspkr: no lowlevel beep support\n" ); +pr_info ("no lowlevel beep support\n" );return -ENODEV ; }
drivers/input/misc/powermate.c +11 -8
@@ -28,6 +28,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/slab.h> #include <linux/module.h>
@@ -167,12 +169,12 @@ static void powermate_sync_state(struct powermate_device *pm) pm->configcr->wIndex =cpu_to_le16 ( pm->static_brightness ); pm->requires_update &= ~UPDATE_STATIC_BRIGHTNESS ; }else { -printk (KERN_ERR "powermate: unknown update required" ); +pr_err ("unknown update required\n" ); pm->requires_update =0 ;/* fudge the bug */ return ; } -/* printk("powermate: %04x %04x\n", pm->configcr->wValue, pm->configcr->wIndex); */ +/* pr_info("%04x %04x\n", pm->configcr->wValue, pm->configcr->wIndex); */ pm->configcr->bRequestType =0x41 ;/* vendor request */ pm->configcr->bRequest =0x01 ;
@@ -183,7 +185,7 @@ static void powermate_sync_state(struct powermate_device *pm) powermate_config_complete, pm);if (usb_submit_urb (pm->config,GFP_ATOMIC )) -printk (KERN_ERR "powermate: usb_submit_urb(config) failed" ); +pr_err ("usb_submit_urb(config) failed\n" ); }/* Called when our asynchronous control message completes. We may need to issue another immediately */
@@ -193,7 +195,7 @@ static void powermate_config_complete(struct urb *urb)unsigned long flags;if (urb->status) -printk (KERN_ERR "powermate: config urb returned %d\n" , urb->status); +pr_err ("config urb returned %d\n" , urb->status);spin_lock_irqsave (&pm->lock, flags);powermate_sync_state (pm);
@@ -346,8 +348,8 @@ static int powermate_probe(struct usb_interface *intf, const struct usb_device_ibreak ;default : input_dev->name = pm_name_soundknob; -printk (KERN_WARNING "powermate: unknown product id %04x\n" , -le16_to_cpu (udev->descriptor.idProduct)); +pr_warning ("unknown product id %04x\n" , +le16_to_cpu (udev->descriptor.idProduct)); } input_dev->phys = pm->phys;
@@ -369,8 +371,9 @@ static int powermate_probe(struct usb_interface *intf, const struct usb_device_i maxp =usb_maxpacket (udev, pipe,usb_pipeout (pipe));if (maxp <POWERMATE_PAYLOAD_SIZE_MIN || maxp >POWERMATE_PAYLOAD_SIZE_MAX ) { -printk (KERN_WARNING "powermate: Expected payload of %d--%d bytes, found %d bytes!\n" , -POWERMATE_PAYLOAD_SIZE_MIN ,POWERMATE_PAYLOAD_SIZE_MAX , maxp); +pr_warning ("Expected payload of %d--%d bytes, found %d bytes!\n" , +POWERMATE_PAYLOAD_SIZE_MIN , +POWERMATE_PAYLOAD_SIZE_MAX , maxp); maxp =POWERMATE_PAYLOAD_SIZE_MAX ; }
drivers/input/misc/uinput.c +10 -8
@@ -29,6 +29,9 @@* 0.1 20/06/2002 * - first public version */ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/poll.h> #include <linux/sched.h> #include <linux/slab.h>
@@ -246,7 +249,7 @@ static int uinput_create_device(struct uinput_device *udev)int error;if (udev->state !=UIST_SETUP_COMPLETE ) { -printk (KERN_DEBUG "%s: write device info first\n" ,UINPUT_NAME ); + printk(KERN_DEBUG pr_fmt("write device info first\n"));return -EINVAL ; }
@@ -306,19 +309,18 @@ static int uinput_validate_absbits(struct input_dev *dev)if ((dev->absmax[cnt] <= dev->absmin[cnt])) { printk(KERN_DEBUG -"%s: invalid abs[%02x] min:%d max:%d\n" , -UINPUT_NAME , cnt, - dev->absmin[cnt], dev->absmax[cnt]); + pr_fmt("invalid abs[%02x] min:%d max:%d\n"), + cnt, dev->absmin[cnt], dev->absmax[cnt]); retval = -EINVAL ;break ; }if (dev->absflat[cnt] > (dev->absmax[cnt] - dev->absmin[cnt])) { printk(KERN_DEBUG -"%s: absflat[%02x] out of range: %d " -"(min:%d/max:%d)\n" , -UINPUT_NAME , cnt, dev->absflat[cnt], - dev->absmin[cnt], dev->absmax[cnt]); + pr_fmt("absflat[%02x] out of range: %d " + "(min:%d/max:%d)\n"), + cnt, dev->absflat[cnt], + dev->absmin[cnt], dev->absmax[cnt]); retval = -EINVAL ;break ; }
drivers/input/misc/winbond-cir.c +4 -2
@@ -44,6 +44,8 @@* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/pnp.h> #include <linux/interrupt.h>
@@ -1581,13 +1583,13 @@ wbcir_init(void)case IR_PROTOCOL_RC6 :break ;default : - printk(KERN_ERR DRVNAME ": Invalid protocol argument\n"); +pr_err ("Invalid protocol argument\n" );return -EINVAL ; } ret =pnp_register_driver (&wbcir_driver);if (ret) - printk(KERN_ERR DRVNAME ": Unable to register driver\n"); +pr_err ("Unable to register driver\n" );return ret; }
drivers/input/misc/wistron_btns.c +15 -14
@@ -17,6 +17,9 @@* with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place Suite 330, Boston, MA 02111-1307, USA. */ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/io.h> #include <linux/dmi.h> #include <linux/init.h>
@@ -111,15 +114,15 @@ static int __init map_bios(void) base =ioremap (0xF0000 ,0x10000 );/* Can't fail */ offset =locate_wistron_bios (base);if (offset <0 ) { -printk (KERN_ERR "wistron_btns: BIOS entry point not found\n" ); +pr_err ("BIOS entry point not found\n" );iounmap (base);return -ENODEV ; } entry_point =readl (base + offset +5 ); printk(KERN_DEBUG -"wistron_btns: BIOS signature found at %p, entry point %08X\n" , - base + offset, entry_point); + pr_fmt("BIOS signature found at %p, entry point %08X\n"), + base + offset, entry_point);if (entry_point >=0xF0000 ) { bios_code_map_base = base;
@@ -128,9 +131,8 @@ static int __init map_bios(void)iounmap (base); bios_code_map_base =ioremap (entry_point & ~0x3FFF ,0x4000 );if (bios_code_map_base ==NULL ) { -printk (KERN_ERR -"wistron_btns: Can't map BIOS code at %08X\n" , - entry_point & ~0x3FFF ); +pr_err ("Can't map BIOS code at %08X\n" , + entry_point & ~0x3FFF ); goto err; } bios_entry_point = bios_code_map_base + (entry_point &0x3FFF );
@@ -138,7 +140,7 @@ static int __init map_bios(void)/* The Windows driver maps 0x10000 bytes, we keep only one page... */ bios_data_map_base =ioremap (0x400 ,0xc00 );if (bios_data_map_base ==NULL ) { -printk (KERN_ERR "wistron_btns: Can't map BIOS data\n" ); +pr_err ("Can't map BIOS data\n" ); goto err_code; }return 0 ;
@@ -1006,13 +1008,13 @@ static int __init select_keymap(void)else if (strcmp (keymap_name,"generic" ) ==0 ) keymap = keymap_wistron_generic;else { -printk (KERN_ERR "wistron_btns: Keymap unknown\n" ); +pr_err ("Keymap unknown\n" );return -EINVAL ; } }if (keymap ==NULL ) {if (!force) { -printk (KERN_ERR "wistron_btns: System unknown\n" ); +pr_err ("System unknown\n" );return -ENODEV ; } keymap = keymap_empty;
@@ -1132,8 +1134,7 @@ static void handle_key(u8 code) } jiffies_last_press = jiffies; }else -printk (KERN_NOTICE -"wistron_btns: Unknown key code %02X\n" , code); +pr_notice ("Unknown key code %02X\n" , code); }static void poll_bios (bool discard)
@@ -1190,9 +1191,9 @@ static int __devinit wistron_setup_keymap(struct input_dev *dev,case KE_END :if (entry->code &FE_UNTESTED ) -printk (KERN_WARNING "Untested laptop multimedia keys, " -"please report success or failure to " -"[email protected]\n" ); +pr_warning ("Untested laptop multimedia keys, " +"please report success or failure to " +"[email protected]\n" );break ; }
drivers/input/misc/yealink.c +3 -2
@@ -46,6 +46,8 @@* 20050816 henk Merge 2.6.13-rc6 */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/init.h> #include <linux/slab.h>
@@ -992,8 +994,7 @@ static int __init yealink_dev_init(void) {int ret =usb_register (&yealink_driver);if (ret ==0 ) - printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" -DRIVER_DESC "\n" ); +pr_info (DRIVER_VERSION ":" DRIVER_DESC "\n" );return ret; }
drivers/input/mouse/alps.c +7 -5
@@ -15,6 +15,8 @@* the Free Software Foundation. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/slab.h> #include <linux/input.h> #include <linux/serio.h>
@@ -25,9 +27,9 @@#undef DEBUG#ifdef DEBUG -#define dbg(format, arg...) printk(KERN_INFO "alps.c: " format "\n", ## arg) +#define dbg(format, arg...) pr_info(format "\n", ##arg)#else -#define dbg(format, arg...) do {} while (0) +#define dbg(format, arg...) do { if (0) pr_info(format "\n", ##arg); } while (0)#endif #define ALPS_OLDPROTO 0x01/* old style input */
@@ -605,12 +607,12 @@ static int alps_hw_init(struct psmouse *psmouse) }if (alps_tap_mode (psmouse, true)) { -printk (KERN_WARNING "alps.c: Failed to enable hardware tapping\n" ); +pr_warning ("Failed to enable hardware tapping\n" );return -1 ; }if (alps_absolute_mode (psmouse)) { -printk (KERN_ERR "alps.c: Failed to enable absolute mode\n" ); +pr_err ("Failed to enable absolute mode\n" );return -1 ; }
@@ -621,7 +623,7 @@ static int alps_hw_init(struct psmouse *psmouse)/* ALPS needs stream mode, otherwise it won't report any data */ if (ps2_command (&psmouse->ps2dev,NULL ,PSMOUSE_CMD_SETSTREAM )) { -printk (KERN_ERR "alps.c: Failed to enable stream mode\n" ); +pr_err ("Failed to enable stream mode\n" );return -1 ; }
drivers/input/mouse/appletouch.c +31 -33
149 lines not on this page · raw message
drivers/input/mouse/bcm5974.c +23 -25
148 lines not on this page · raw message
drivers/input/mouse/elantech.c +2 -2
@@ -171,8 +171,8 @@ static void elantech_packet_dump(unsigned char *packet, int size) printk(KERN_DEBUG pr_fmt("PS/2 packet [")); for (i = 0; i < size; i++) - printk("%s0x%02x ", (i) ? ", " : " ", packet[i]); - printk("]\n"); + pr_cont(" 0x%02x", packet[i]); + pr_cont(" ]\n"); }/*
drivers/input/mouse/inport.c +5 -3
@@ -32,6 +32,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/ioport.h> #include <linux/init.h>
@@ -133,7 +135,7 @@ static int __init inport_init(void)int err;if (!request_region (INPORT_BASE ,INPORT_EXTENT ,"inport" )) { -printk (KERN_ERR "inport.c: Can't allocate ports at %#x\n" ,INPORT_BASE ); +pr_err ("Can't allocate ports at %#x\n" ,INPORT_BASE );return -EBUSY ; }
@@ -141,14 +143,14 @@ static int __init inport_init(void) b =inb (INPORT_SIGNATURE_PORT ); c =inb (INPORT_SIGNATURE_PORT );if (a == b || a != c) { -printk (KERN_INFO "inport.c: Didn't find InPort mouse at %#x\n" ,INPORT_BASE ); +pr_info ("Didn't find InPort mouse at %#x\n" ,INPORT_BASE ); err = -ENODEV ; goto err_release_region; } inport_dev =input_allocate_device ();if (!inport_dev) { -printk (KERN_ERR "inport.c: Not enough memory for input device\n" ); +pr_err ("Not enough memory for input device\n" ); err = -ENOMEM ; goto err_release_region; }
drivers/input/mouse/lifebook.c +3 -2
@@ -12,6 +12,8 @@* the Free Software Foundation. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/input.h> #include <linux/serio.h> #include <linux/libps2.h>
@@ -169,8 +171,7 @@ static psmouse_ret_t lifebook_process_byte(struct psmouse *psmouse)if (relative_packet) {if (!dev2) -printk (KERN_WARNING "lifebook.c: got relative packet " -"but no relative device set up\n" ); +pr_warning ("got relative packet but no relative device set up\n" ); }else {if (lifebook_use_6byte_proto) { input_report_abs(dev1, ABS_X,
drivers/input/mouse/logibm.c +6 -4
@@ -33,6 +33,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/delay.h> #include <linux/ioport.h>
@@ -104,7 +106,7 @@ static irqreturn_t logibm_interrupt(int irq, void *dev_id)static int logibm_open (struct input_dev *dev) {if (request_irq (logibm_irq, logibm_interrupt,0 ,"logibm" ,NULL )) { -printk (KERN_ERR "logibm.c: Can't allocate irq %d\n" , logibm_irq); +pr_err ("Can't allocate irq %d\n" , logibm_irq);return -EBUSY ; }outb (LOGIBM_ENABLE_IRQ ,LOGIBM_CONTROL_PORT );
@@ -122,7 +124,7 @@ static int __init logibm_init(void)int err;if (!request_region (LOGIBM_BASE ,LOGIBM_EXTENT ,"logibm" )) { -printk (KERN_ERR "logibm.c: Can't allocate ports at %#x\n" ,LOGIBM_BASE ); +pr_err ("Can't allocate ports at %#x\n" ,LOGIBM_BASE );return -EBUSY ; }
@@ -131,7 +133,7 @@ static int __init logibm_init(void)udelay (100 );if (inb (LOGIBM_SIGNATURE_PORT ) !=LOGIBM_SIGNATURE_BYTE ) { -printk (KERN_INFO "logibm.c: Didn't find Logitech busmouse at %#x\n" ,LOGIBM_BASE ); +pr_info ("Didn't find Logitech busmouse at %#x\n" ,LOGIBM_BASE ); err = -ENODEV ; goto err_release_region; }
@@ -141,7 +143,7 @@ static int __init logibm_init(void) logibm_dev =input_allocate_device ();if (!logibm_dev) { -printk (KERN_ERR "logibm.c: Not enough memory for input device\n" ); +pr_err ("Not enough memory for input device\n" ); err = -ENOMEM ; goto err_release_region; }
drivers/input/mouse/logips2pp.c +7 -6
@@ -9,6 +9,8 @@* the Free Software Foundation. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/input.h> #include <linux/serio.h> #include <linux/libps2.h>
@@ -84,8 +86,8 @@ static psmouse_ret_t ps2pp_process_byte(struct psmouse *psmouse)#ifdef DEBUG default : -printk (KERN_WARNING "psmouse.c: Received PS2++ packet #%x, but don't know how to handle.\n" , - (packet[1 ] >>4 ) | (packet[0 ] &0x30 )); +pr_warning ("Received PS2++ packet #%x, but don't know how to handle\n" , + (packet[1 ] >>4 ) | (packet[0 ] &0x30 ));#endif } }else {
@@ -382,7 +384,7 @@ int ps2pp_init(struct psmouse *psmouse, bool set_properties) } }else { -printk (KERN_WARNING "logips2pp: Detected unknown logitech mouse model %d\n" , model); +pr_warning ("Detected unknown logitech mouse model %d\n" , model); }if (set_properties) {
@@ -400,9 +402,8 @@ int ps2pp_init(struct psmouse *psmouse, bool set_properties) error =device_create_file (&psmouse->ps2dev.serio->dev, &psmouse_attr_smartscroll.dattr);if (error) { -printk (KERN_ERR -"logips2pp.c: failed to create smartscroll " -"sysfs attribute, error: %d\n" , error); +pr_err ("failed to create smartscroll sysfs attribute, error: %d\n" , + error);return -1 ; } }
drivers/input/mouse/pc110pad.c +6 -4
@@ -29,6 +29,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h>
@@ -114,22 +116,22 @@ static int __init pc110pad_init(void)return -ENODEV ;if (!request_region (pc110pad_io,4 ,"pc110pad" )) { -printk (KERN_ERR "pc110pad: I/O area %#x-%#x in use.\n" , - pc110pad_io, pc110pad_io +4 ); +pr_err ("I/O area %#x-%#x in use\n" , + pc110pad_io, pc110pad_io +4 );return -EBUSY ; }outb (PC110PAD_OFF , pc110pad_io +2 );if (request_irq (pc110pad_irq, pc110pad_interrupt,0 ,"pc110pad" ,NULL )) { -printk (KERN_ERR "pc110pad: Unable to get irq %d.\n" , pc110pad_irq); +pr_err ("Unable to get irq %d\n" , pc110pad_irq); err = -EBUSY ; goto err_release_region; } pc110pad_dev =input_allocate_device ();if (!pc110pad_dev) { -printk (KERN_ERR "pc110pad: Not enough memory.\n" ); +pr_err ("Not enough memory\n" ); err = -ENOMEM ; goto err_free_irq; }
drivers/input/mouse/psmouse-base.c +27 -25
137 lines not on this page · raw message
drivers/input/mouse/rpcmouse.c +3 -1
@@ -17,6 +17,8 @@* the complete state and then work out if something has changed. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/ptrace.h> #include <linux/interrupt.h>
@@ -87,7 +89,7 @@ static int __init rpcmouse_init(void) rpcmouse_lasty = (short )iomd_readl (IOMD_MOUSEY );if (request_irq (IRQ_VSYNCPULSE , rpcmouse_irq,IRQF_SHARED ,"rpcmouse" , rpcmouse_dev)) { -printk (KERN_ERR "rpcmouse: unable to allocate VSYNC interrupt\n" ); +pr_err ("unable to allocate VSYNC interrupt\n" ); err = -EBUSY ; goto err_free_dev; }
drivers/input/mouse/sentelic.c +8 -5
@@ -19,6 +19,8 @@* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/version.h> #include <linux/input.h>
@@ -608,11 +610,13 @@ static void fsp_packet_debug(unsigned char packet[]) ps2_packet_cnt++; jiffies_msec =jiffies_to_msecs (jiffies); -printk (KERN_DEBUG "%08dms PS/2 packets: %02x, %02x, %02x, %02x\n" , - jiffies_msec, packet[0 ], packet[1 ], packet[2 ], packet[3 ]); + printk(KERN_DEBUG + pr_fmt("%08dms PS/2 packets: %02x, %02x, %02x, %02x\n"), + jiffies_msec, packet[0], packet[1], packet[2], packet[3]);if (jiffies_msec - ps2_last_second >1000 ) { -printk (KERN_DEBUG "PS/2 packets/sec = %d\n" , ps2_packet_cnt); + printk(KERN_DEBUG pr_fmt("PS/2 packets/sec = %d\n"), + ps2_packet_cnt); ps2_packet_cnt =0 ; ps2_last_second = jiffies_msec; }
@@ -821,8 +825,7 @@ int fsp_init(struct psmouse *psmouse)return -ENODEV ; } -printk (KERN_INFO -"Finger Sensing Pad, hw: %d.%d.%d, sw: %s, buttons: %d\n" , +pr_info ("Finger Sensing Pad, hw: %d.%d.%d, sw: %s, buttons: %d\n" , ver >>4 , ver &0x0F , rev, fsp_drv_ver, buttons &7 ); psmouse->private = priv =kzalloc (sizeof (struct fsp_data ),GFP_KERNEL );
drivers/input/mouse/sermouse.c +4 -2
@@ -26,6 +26,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/delay.h> #include <linux/module.h> #include <linux/slab.h>
@@ -186,8 +188,8 @@ static void sermouse_process_ms(struct sermouse *sermouse, signed char data)default :/* We don't decode anything else yet. */ -printk (KERN_WARNING -"sermouse.c: Received MZ++ packet %x, don't know how to handle.\n" , buf[1 ]); +pr_warning ("Received MZ++ packet %x, don't know how to handle\n" , + buf[1 ]);break ; }
drivers/input/mouse/synaptics.c +16 -14
@@ -23,6 +23,8 @@* Trademarks are the property of their respective owners. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/dmi.h> #include <linux/input.h>
@@ -157,7 +159,7 @@ static int synaptics_capability(struct psmouse *psmouse)if (SYN_EXT_CAP_REQUESTS (priv->capabilities) >=1 ) {if (synaptics_send_cmd (psmouse,SYN_QUE_EXT_CAPAB , cap)) { -printk (KERN_ERR "Synaptics claims to have extended capabilities," +pr_err ("Synaptics claims to have extended capabilities," " but I'm not able to read them.\n" ); }else { priv->ext_cap = (cap[0 ] <<16 ) | (cap[1 ] <<8 ) | cap[2 ];
@@ -173,7 +175,7 @@ static int synaptics_capability(struct psmouse *psmouse)if (SYN_EXT_CAP_REQUESTS (priv->capabilities) >=4 ) {if (synaptics_send_cmd (psmouse,SYN_QUE_EXT_CAPAB_0C , cap)) { -printk (KERN_ERR "Synaptics claims to have extended capability 0x0c," +pr_err ("Synaptics claims to have extended capability 0x0c," " but I'm not able to read it.\n" ); }else { priv->ext_cap_0c = (cap[0 ] <<16 ) | (cap[1 ] <<8 ) | cap[2 ];
@@ -223,7 +225,7 @@ static int synaptics_resolution(struct psmouse *psmouse)if (SYN_EXT_CAP_REQUESTS (priv->capabilities) >=5 &&SYN_CAP_MAX_DIMENSIONS (priv->ext_cap_0c)) {if (synaptics_send_cmd (psmouse,SYN_QUE_EXT_DIMENSIONS , max)) { -printk (KERN_ERR "Synaptics claims to have dimensions query," +pr_err ("Synaptics claims to have dimensions query," " but I'm not able to read it.\n" ); }else { priv->x_max = (max[0 ] <<5 ) | ((max[1 ] &0x0f ) <<1 );
@@ -327,7 +329,7 @@ static void synaptics_pt_activate(struct psmouse *psmouse) priv->mode &= ~SYN_BIT_FOUR_BYTE_CLIENT ;if (synaptics_mode_cmd (psmouse, priv->mode)) -printk (KERN_INFO "synaptics: failed to switch guest protocol\n" ); +pr_info ("failed to switch guest protocol\n" ); } }
@@ -337,7 +339,7 @@ static void synaptics_pt_create(struct psmouse *psmouse) serio =kzalloc (sizeof (struct serio ),GFP_KERNEL );if (!serio) { -printk (KERN_ERR "synaptics: not enough memory to allocate pass-through port\n" ); +pr_err ("not enough memory to allocate pass-through port\n" );return ; }
@@ -349,7 +351,7 @@ static void synaptics_pt_create(struct psmouse *psmouse) psmouse->pt_activate = synaptics_pt_activate; -printk (KERN_INFO "serio: %s port at %s\n" , serio->name, psmouse->phys); +pr_info ("%s port at %s\n" , serio->name, psmouse->phys);serio_register_port (serio); }
@@ -552,7 +554,7 @@ static int synaptics_validate_byte(unsigned char packet[], int idx, unsigned chareturn (packet[idx] & oldabs_mask[idx]) == oldabs_rslt[idx];default : -printk (KERN_ERR "synaptics: unknown packet type %d\n" , pkt_type); +pr_err ("unknown packet type %d\n" , pkt_type);return 0 ; } }
@@ -563,7 +565,7 @@ static unsigned char synaptics_detect_pkt_type(struct psmouse *psmouse)for (i =0 ; i <5 ; i++)if (!synaptics_validate_byte (psmouse->packet, i,SYN_NEWABS_STRICT )) { -printk (KERN_INFO "synaptics: using relaxed packet validation\n" ); +pr_info ("using relaxed packet validation\n" );return SYN_NEWABS_RELAXED ; }
@@ -663,7 +665,7 @@ static int synaptics_reconnect(struct psmouse *psmouse)return -1 ;if (synaptics_query_hardware (psmouse)) { -printk (KERN_ERR "Unable to query Synaptics hardware.\n" ); +pr_err ("Unable to query Synaptics hardware\n" );return -1 ; }
@@ -674,7 +676,7 @@ static int synaptics_reconnect(struct psmouse *psmouse)return -1 ;if (synaptics_set_absolute_mode (psmouse)) { -printk (KERN_ERR "Unable to initialize Synaptics hardware.\n" ); +pr_err ("Unable to initialize Synaptics hardware\n" );return -1 ; }
@@ -736,18 +738,18 @@ int synaptics_init(struct psmouse *psmouse)psmouse_reset (psmouse);if (synaptics_query_hardware (psmouse)) { -printk (KERN_ERR "Unable to query Synaptics hardware.\n" ); +pr_err ("Unable to query Synaptics hardware\n" ); goto init_fail; }if (synaptics_set_absolute_mode (psmouse)) { -printk (KERN_ERR "Unable to initialize Synaptics hardware.\n" ); +pr_err ("Unable to initialize Synaptics hardware\n" ); goto init_fail; } priv->pkt_type =SYN_MODEL_NEWABS (priv->model_id) ?SYN_NEWABS :SYN_OLDABS ; -printk (KERN_INFO "Synaptics Touchpad, model: %ld, fw: %ld.%ld, id: %#lx, caps: %#lx/%#lx/%#lx\n" , +pr_info ("Synaptics Touchpad, model: %ld, fw: %ld.%ld, id: %#lx, caps: %#lx/%#lx/%#lx\n" ,SYN_ID_MODEL (priv->identity),SYN_ID_MAJOR (priv->identity),SYN_ID_MINOR (priv->identity), priv->model_id, priv->capabilities, priv->ext_cap, priv->ext_cap_0c);
@@ -782,7 +784,7 @@ int synaptics_init(struct psmouse *psmouse)* thye same as rate of standard PS/2 mouse. */ if (psmouse->rate >=80 && impaired_toshiba_kbc) { -printk (KERN_INFO "synaptics: Toshiba %s detected, limiting rate to 40pps.\n" , +pr_info ("Toshiba %s detected, limiting rate to 40pps\n" ,dmi_get_system_info (DMI_PRODUCT_NAME )); psmouse->rate =40 ; }
drivers/input/mouse/trackpoint.c +5 -5
@@ -8,6 +8,8 @@* Trademarks are the property of their respective owners. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/slab.h> #include <linux/delay.h> #include <linux/serio.h>
@@ -297,7 +299,7 @@ int trackpoint_detect(struct psmouse *psmouse, bool set_properties)return 0 ;if (trackpoint_read (&psmouse->ps2dev,TP_EXT_BTN , &button_info)) { -printk (KERN_WARNING "trackpoint.c: failed to get extended button data\n" ); +pr_warning ("failed to get extended button data\n" ); button_info =0 ; }
@@ -319,15 +321,13 @@ int trackpoint_detect(struct psmouse *psmouse, bool set_properties) error =sysfs_create_group (&ps2dev->serio->dev.kobj, &trackpoint_attr_group);if (error) { -printk (KERN_ERR -"trackpoint.c: failed to create sysfs attributes, error: %d\n" , - error); +pr_err ("failed to create sysfs attributes, error: %d\n" , error);kfree (psmouse->private); psmouse->private =NULL ;return -1 ; } -printk (KERN_INFO "IBM TrackPoint firmware: 0x%02x, buttons: %d/%d\n" , +pr_info ("IBM TrackPoint firmware: 0x%02x, buttons: %d/%d\n" , firmware_id, (button_info &0xf0 ) >>4 , button_info &0x0f );return 0 ;
drivers/input/mouse/vsxxxaa.c +21 -23
109 lines not on this page · raw message
drivers/input/serio/hp_sdc.c +26 -27
53 lines not on this page · raw message
drivers/input/serio/hp_sdc_mlc.c +24 -21
45 lines not on this page · raw message
drivers/input/serio/i8042-x86ia64io.h +20 -23
43 lines not on this page · raw message
drivers/input/serio/i8042.c +28 -34
62 lines not on this page · raw message
drivers/input/touchscreen/h3600_ts_input.c +5 -3
Lines of this file are not shown. View the raw message.
drivers/input/touchscreen/hp680_ts_input.c +1 -2
Lines of this file are not shown. View the raw message.
drivers/input/touchscreen/jornada720_ts.c +3 -1
Lines of this file are not shown. View the raw message.
drivers/input/touchscreen/usbtouchscreen.c +4 -2
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Dmitry Torokhov
maintainerHi Joe,
Quoted 7 lines · Joe Perches
Remove prefixes from printks and convert to pr_fmt/pr_<level>.
Always make output prefix match module name. There are some existing uses that do not. For instance:
spaceorb used "input: " once, probably a copy/paste error, newtonkbd as well. Synaptics used "serio: ", etc.
Quoted 5 lines
A few miscellaneous typos corrected.
Converted a few uses of usb macros err topr_err.Compiled x86 only, some files not compile tested
Thanks for doing this, however instead of using pr_xxx() I'd like drivers that are integrated in driver model (serio, usb, gameport, etc, i.e. when we have 'struct device' available, exept for psmouse) to use drv_xxx() instead.
drivers/input/mouse/synaptics.c line 27
Quoted 11 lines
drivers/input/mouse/synaptics.c +2
-0@@ -23,6 +23,8 @@* Trademarks are the property of their respective owners. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +
That would make synaptics messages to come as "psmouse", right? I think we shoudl use
#define pr_fmt(fmt) "synaptics: " fmt
here and in the rest of specialized PS/2 protocol handlers.
Thanks.
Signature · 1 line
Dmitry
Quoted 1 line · Dmitry Torokhov
Hi Joe,
Hi Dmitry.
Quoted 6 lines · Joe Perches
Quoted 1 line
Remove prefixes from printks and convert to pr_fmt/pr_<level>.
Thanks for doing this, however instead of using
pr_xxx()I'd like drivers that are integrated in driver model (serio, usb, gameport, etc, i.e. when we have 'struct device' available, exept for psmouse) to usedrv_xxx()instead.
These files?
$ grep -rPl --include=*.[ch] "\bstruct\s+device\b" drivers/input | \ xargs grep -wl pr_fmt drivers/input/keyboard/omap-keypad.c drivers/input/mousedev.c drivers/input/serio/serio.c drivers/input/serio/i8042.c drivers/input/evdev.c drivers/input/joydev.c drivers/input/gameport/gameport.c drivers/input/touchscreen/htcpen.c drivers/input/input-polldev.c drivers/input/input.c drivers/input/tablet/aiptek.c drivers/input/misc/winbond-cir.c drivers/input/misc/yealink.c drivers/input/misc/ati_remote2.c drivers/input/misc/wistron_btns.c drivers/input/misc/ati_remote.c drivers/input/mouse/psmouse-base.c
Quoted 1 line
That would make synaptics messages to come as "psmouse", right?
Yes.
Quoted 3 lines
I think we should use
#define pr_fmt(fmt) "synaptics: " fmthere and in the rest of specialized PS/2 protocol handlers.
Perhaps convert to what elantech uses
#define pr_fmt(fmt) KBUILD_BASENAME ": " fmt
$ grep -l "define pr_fmt" drivers/input/mouse/*.[ch] | \ xargs grep -il "ps2" drivers/input/mouse/alps.c drivers/input/mouse/elantech.c drivers/input/mouse/lifebook.c drivers/input/mouse/logips2pp.c drivers/input/mouse/psmouse-base.c drivers/input/mouse/sentelic.c drivers/input/mouse/synaptics.c drivers/input/mouse/trackpoint.c
Which ones do you want converted?
Any others?
Dmitry Torokhov
maintainerQuoted 24 lines · Joe Perches
Quoted 1 line · Dmitry Torokhov
Hi Joe,
Hi Dmitry.
Quoted 6 lines · Joe Perches
Quoted 1 line
Remove prefixes from printks and convert to pr_fmt/pr_<level>.
Thanks for doing this, however instead of using
pr_xxx()I'd like drivers that are integrated in driver model (serio, usb, gameport, etc, i.e. when we have 'struct device' available, exept for psmouse) to usedrv_xxx()instead.These files?
$ grep -rPl --include=*.[ch] "\bstruct\s+device\b" drivers/input | \ xargs grep -wl pr_fmt drivers/input/keyboard/omap-keypad.c drivers/input/mousedev.c drivers/input/serio/serio.c drivers/input/serio/i8042.c drivers/input/evdev.c drivers/input/joydev.c drivers/input/gameport/gameport.c drivers/input/touchscreen/htcpen.c drivers/input/input-polldev.c
Quoted 8 lines
drivers/input/input.c drivers/input/tablet/aiptek.c drivers/input/misc/winbond-cir.c drivers/input/misc/yealink.c drivers/input/misc/ati_remote2.c drivers/input/misc/wistron_btns.c drivers/input/misc/ati_remote.c drivers/input/mouse/psmouse-base.c
There should be more. USB for example. Basically anything but very old legacy drivers that never been converted to the 2.6 device model.
Quoted 12 lines
Quoted 2 lines
That would make synaptics messages to come as "psmouse", right?
Yes.
Quoted 3 lines
I think we should use
#define pr_fmt(fmt) "synaptics: " fmthere and in the rest of specialized PS/2 protocol handlers.
Perhaps convert to what elantech uses
#definepr_fmt(fmt)KBUILD_BASENAME": " fmt
Quoted 7 lines
$ grep -l "define pr_fmt" drivers/input/mouse/*.[ch] | \ xargs grep -il "ps2" drivers/input/mouse/alps.c drivers/input/mouse/elantech.c drivers/input/mouse/lifebook.c drivers/input/mouse/logips2pp.c drivers/input/mouse/psmouse-base.c
psmouse-base should use KBUILD_MODNAME, for the rest of these KBUILD_BASENAME seems to fit.
Quoted 7 lines
drivers/input/mouse/sentelic.cdrivers/input/mouse/synaptics.cdrivers/input/mouse/trackpoint.cWhich ones do you want converted?
Any others?
No, I think this is it as far as PS/2 mice go.
Signature · 1 line
Dmitry
Quoted 28 lines · Dmitry Torokhov
Quoted 19 lines · Joe Perches
Quoted 6 lines · Dmitry Torokhov
Quoted 1 line · Joe Perches
Remove prefixes from printks and convert to pr_fmt/pr_<level>.
Thanks for doing this, however instead of using
pr_xxx()I'd like drivers that are integrated in driver model (serio, usb, gameport, etc, i.e. when we have 'struct device' available, exept for psmouse) to usedrv_xxx()instead.These files?
$ grep -rPl --include=*.[ch] "\bstruct\s+device\b" drivers/input | \ xargs grep -wl pr_fmt drivers/input/keyboard/omap-keypad.c drivers/input/mousedev.c drivers/input/serio/serio.c drivers/input/serio/i8042.c drivers/input/evdev.c drivers/input/joydev.c drivers/input/gameport/gameport.c drivers/input/touchscreen/htcpen.c drivers/input/input-polldev.cQuoted 8 lines
drivers/input/input.c drivers/input/tablet/aiptek.c drivers/input/misc/winbond-cir.c drivers/input/misc/yealink.c drivers/input/misc/ati_remote2.c drivers/input/misc/wistron_btns.c drivers/input/misc/ati_remote.c drivers/input/mouse/psmouse-base.c
Quoted 2 lines
There should be more. USB for example. Basically anything but very old legacy drivers that never been converted to the 2.6 device model.
I propose you take the patch as-is and then conversions from pr_<level>(...) to dev_<level>(struct device *, ...) can be done as appropriate.
Quoted 7 lines
Quoted 7 lines
$ grep -l "define pr_fmt" drivers/input/mouse/*.[ch] | \ xargs grep -il "ps2" drivers/input/mouse/alps.c drivers/input/mouse/elantech.c drivers/input/mouse/lifebook.c drivers/input/mouse/logips2pp.c drivers/input/mouse/psmouse-base.c
Quoted 9 lines
psmouse-base should use
KBUILD_MODNAME, for the rest of theseKBUILD_BASENAMEseems to fit.Quoted 7 lines
drivers/input/mouse/sentelic.cdrivers/input/mouse/synaptics.cdrivers/input/mouse/trackpoint.cWhich ones do you want converted?
Any others?
No, I think this is it as far as PS/2 mice go.
OK, done.
Do you want a diff from the original,
a new single patch or patches by directory?
ie:
drivers/input/gameportdrivers/input/joystickdrivers/input/keyboarddrivers/input/miscdrivers/input/mousedrivers/input/seriodrivers/input/tabletdrivers/input/touchscreendrivers/input
Dmitry Torokhov
maintainerQuoted 54 lines · Joe Perches
Quoted 26 lines · Dmitry Torokhov
Quoted 16 lines · Joe Perches
On Tue, 2010-08-03 at 21:32 -0700, Dmitry Torokhov wrote:
These files?
$ grep -rPl --include=*.[ch] "\bstruct\s+device\b" drivers/input | \xargs grep -wl
pr_fmt
drivers/input/keyboard/omap-keypad.cdrivers/input/mousedev.cdrivers/input/serio/serio.cdrivers/input/serio/i8042.cdrivers/input/evdev.cdrivers/input/joydev.cdrivers/input/gameport/gameport.cdrivers/input/touchscreen/htcpen.cdrivers/input/input-polldev.cQuoted 8 lines
drivers/input/input.cdrivers/input/tablet/aiptek.cdrivers/input/misc/winbond-cir.cdrivers/input/misc/yealink.cdrivers/input/misc/ati_remote2.cdrivers/input/misc/wistron_btns.cdrivers/input/misc/ati_remote.cdrivers/input/mouse/psmouse-base.cQuoted 2 lines
There should be more. USB for example. Basically anything but very old legacy drivers that never been converted to the 2.6 device model.
I propose you take the patch as-is and then conversions from pr_<level>(...) to dev_<level>(struct device *, ...) can be done as appropriate.
Quoted 20 lines
Quoted 9 lines
$ grep -l "define pr_fmt" drivers/input/mouse/*.[ch] | \xargs grep -il "ps2"
drivers/input/mouse/alps.cdrivers/input/mouse/elantech.cdrivers/input/mouse/lifebook.cdrivers/input/mouse/logips2pp.cdrivers/input/mouse/psmouse-base.cpsmouse-base should use
KBUILD_MODNAME, for the rest of theseKBUILD_BASENAMEseems to fit.Quoted 7 lines
drivers/input/mouse/sentelic.cdrivers/input/mouse/synaptics.cdrivers/input/mouse/trackpoint.cWhich ones do you want converted?
Any others?
Quoted 6 lines
Quoted 1 line
Quoted 1 line
No, I think this is it as far as PS/2 mice go.
OK, done.
Do you want a diff from the original,
a new single patch or patches by directory?
Split by directories, if possible, please.
Signature · 1 line
Dmitry
PATCH 1/9 drivers/input/gameport: Use pr_fmt and pr_<level>
In reply to Dmitry Torokhov--- drivers/input/gameport/emu10k1-gp.c | 4 +++- drivers/input/gameport/fm801-gp.c | 8 +++++--- drivers/input/gameport/lightning.c | 6 ++++-- drivers/input/gameport/ns558.c | 8 +++++--- 4 files changed, 17 insertions(+), 9 deletions(-)
drivers/input/gameport/emu10k1-gp.c +3 -1
@@ -26,6 +26,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <asm/io.h> #include <linux/module.h>
@@ -75,7 +77,7 @@ static int __devinit emu_probe(struct pci_dev *pdev, const struct pci_device_id emu =kzalloc (sizeof (struct emu ),GFP_KERNEL ); port =gameport_allocate_port ();if (!emu || !port) { -printk (KERN_ERR "emu10k1-gp: Memory allocation failed\n" ); +pr_err ("Memory allocation failed\n" );release_region (ioport, iolen);kfree (emu);gameport_free_port (port);
drivers/input/gameport/fm801-gp.c +5 -3
@@ -20,6 +20,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <asm/io.h> #include <linux/delay.h> #include <linux/errno.h>
@@ -87,7 +89,7 @@ static int __devinit fm801_gp_probe(struct pci_dev *pci, const struct pci_device gp =kzalloc (sizeof (struct fm801_gp ),GFP_KERNEL ); port =gameport_allocate_port ();if (!gp || !port) { -printk (KERN_ERR "fm801-gp: Memory allocation failed\n" ); +pr_err ("Memory allocation failed\n" ); error = -ENOMEM ; goto err_out_free; }
@@ -108,8 +110,8 @@ static int __devinit fm801_gp_probe(struct pci_dev *pci, const struct pci_device gp->gameport = port; gp->res_port =request_region (port->io,0x10 ,"FM801 GP" );if (!gp->res_port) { -printk (KERN_DEBUG "fm801-gp: unable to grab region 0x%x-0x%x\n" , - port->io, port->io +0x0f ); + printk(KERN_DEBUG pr_fmt("unable to grab region 0x%x-0x%x\n"), + port->io, port->io + 0x0f); error = -EBUSY ; goto err_out_disable_dev; }
drivers/input/gameport/lightning.c +4 -2
@@ -26,6 +26,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <asm/io.h> #include <linux/delay.h> #include <linux/errno.h>
@@ -228,7 +230,7 @@ static int __init l4_create_ports(int card_no) l4 = &l4_ports[idx];if (!(l4->gameport = port =gameport_allocate_port ())) { -printk (KERN_ERR "lightning: Memory allocation failed\n" ); +pr_err ("Memory allocation failed\n" );while (--i >=0 ) {gameport_free_port (l4->gameport); l4->gameport =NULL ;
@@ -287,7 +289,7 @@ static int __init l4_add_card(int card_no)if (result)return result; -printk (KERN_INFO "gameport: PDPI Lightning 4 %s card v%d.%d at %#x\n" , +pr_info ("PDPI Lightning 4 %s card v%d.%d at %#x\n" , card_no ?"secondary" :"primary" , rev >>4 , rev,L4_PORT );for (i =0 ; i <4 ; i++) {
drivers/input/gameport/ns558.c +5 -3
@@ -27,6 +27,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <asm/io.h> #include <linux/module.h>
@@ -142,7 +144,7 @@ static int ns558_isa_probe(int io) ns558 =kzalloc (sizeof (struct ns558 ),GFP_KERNEL ); port =gameport_allocate_port ();if (!ns558 || !port) { -printk (KERN_ERR "ns558: Memory allocation failed.\n" ); +pr_err ("Memory allocation failed\n" );release_region (io & (-1 << i), (1 << i));kfree (ns558);gameport_free_port (port);
@@ -201,7 +203,7 @@ static int ns558_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *did)struct gameport *port;if (!pnp_port_valid (dev,0 )) { -printk (KERN_WARNING "ns558: No i/o ports on a gameport? Weird\n" ); +pr_warning ("No i/o ports on a gameport? Weird\n" );return -ENODEV ; }
@@ -214,7 +216,7 @@ static int ns558_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *did) ns558 =kzalloc (sizeof (struct ns558 ),GFP_KERNEL ); port =gameport_allocate_port ();if (!ns558 || !port) { -printk (KERN_ERR "ns558: Memory allocation failed\n" ); +pr_err ("Memory allocation failed\n" );kfree (ns558);gameport_free_port (port);return -ENOMEM ;
Signature · 1 line
1.7.2.19.g9a302
PATCH 2/9 drivers/input/joystick: Use pr_fmt and pr_<level>
In reply to Dmitry TorokhovConvert some bare printks to pr_cont
Add argument checking to non-debug #define dbg
--- drivers/input/joystick/a3d.c | 9 +++- drivers/input/joystick/adi.c | 12 +++-- drivers/input/joystick/amijoy.c | 4 +- drivers/input/joystick/analog.c | 15 ++++--- drivers/input/joystick/cobra.c | 7 ++- drivers/input/joystick/db9.c | 16 ++++--- drivers/input/joystick/gf2k.c | 7 ++- drivers/input/joystick/grip_mp.c | 15 ++++--- drivers/input/joystick/guillemot.c | 11 +++- drivers/input/joystick/iforce/iforce-packets.c | 8 ++- drivers/input/joystick/interact.c | 7 ++- drivers/input/joystick/joydump.c | 40 +++++++++------- drivers/input/joystick/sidewinder.c | 58 +++++++++++++----------- drivers/input/joystick/spaceball.c | 6 ++- drivers/input/joystick/spaceorb.c | 15 ++++-- drivers/input/joystick/turbografx.c | 16 ++++--- drivers/input/joystick/walkera0701.c | 6 ++- drivers/input/joystick/xpad.c | 4 +- 18 files changed, 156 insertions(+), 100 deletions(-)
drivers/input/joystick/a3d.c +6 -3
@@ -26,6 +26,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/module.h> #include <linux/slab.h>
@@ -295,8 +297,9 @@ static int a3d_connect(struct gameport *gameport, struct gameport_driver *drv) a3d->mode = data[0 ];if (!a3d->mode || a3d->mode >5 ) { -printk (KERN_WARNING "a3d.c: Unknown A3D device detected " -"(%s, id=%d), contact <[email protected]>\n" , gameport->phys, a3d->mode); +pr_warning ("Unknown A3D device detected " +"(%s, id=%d), contact <[email protected]>\n" , + gameport->phys, a3d->mode); err = -ENODEV ; goto fail2; }
@@ -360,7 +363,7 @@ static int a3d_connect(struct gameport *gameport, struct gameport_driver *drv)a3d_read (a3d, data);if (!(a3d->adc = adc =gameport_allocate_port ())) -printk (KERN_ERR "a3d: Not enough memory for ADC port\n" ); +pr_err ("Not enough memory for ADC port\n" );else { adc->port_data = a3d; adc->open = a3d_adc_open;
drivers/input/joystick/adi.c +8 -4
@@ -26,6 +26,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/delay.h> #include <linux/kernel.h> #include <linux/module.h>
@@ -336,7 +338,8 @@ static void adi_id_decode(struct adi *adi, struct adi_port *port)return ;if (adi->ret < (t =adi_get_bits (adi,10 ))) { -printk (KERN_WARNING "adi: Short ID packet: reported: %d != read: %d\n" , t, adi->ret); +pr_warning ("Short ID packet: reported: %d != read: %d\n" , + t, adi->ret);return ; }
@@ -347,7 +350,7 @@ static void adi_id_decode(struct adi *adi, struct adi_port *port) adi->length =adi_get_bits (adi,10 );if (adi->length >=ADI_MAX_LENGTH || adi->length <ADI_MIN_LENGTH ) { -printk (KERN_WARNING "adi: Bad data packet length (%d).\n" , adi->length); +pr_warning ("Bad data packet length (%d)\n" , adi->length); adi->length =0 ;return ; }
@@ -356,7 +359,7 @@ static void adi_id_decode(struct adi *adi, struct adi_port *port) adi->buttons =adi_get_bits (adi,6 );if (adi_get_bits (adi,6 ) !=8 && adi->hats) { -printk (KERN_WARNING "adi: Other than 8-dir POVs not supported yet.\n" ); +pr_warning ("Other than 8-dir POVs not supported yet\n" ); adi->length =0 ;return ; }
@@ -379,7 +382,8 @@ static void adi_id_decode(struct adi *adi, struct adi_port *port) t =8 + adi->buttons + adi->axes10 *10 + adi->axes8 *8 + adi->hats *4 ;if (adi->length != t && adi->length != t + (t &1 )) { -printk (KERN_WARNING "adi: Expected length %d != data length %d\n" , t, adi->length); +pr_warning ("Expected length %d != data length %d\n" , + t, adi->length); adi->length =0 ;return ; }
drivers/input/joystick/amijoy.c +3 -1
@@ -26,6 +26,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/types.h> #include <linux/errno.h> #include <linux/kernel.h>
@@ -84,7 +86,7 @@ static int amijoy_open(struct input_dev *dev)return err;if (!amijoy_used &&request_irq (IRQ_AMIGA_VERTB , amijoy_interrupt,0 ,"amijoy" , amijoy_interrupt)) { -printk (KERN_ERR "amijoy.c: Can't allocate irq %d\n" ,IRQ_AMIGA_VERTB ); +pr_err ("Can't allocate irq %d\n" ,IRQ_AMIGA_VERTB ); err = -EBUSY ; goto out; }
drivers/input/joystick/analog.c +9 -6
@@ -26,6 +26,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/delay.h> #include <linux/kernel.h> #include <linux/module.h>
@@ -531,9 +533,9 @@ static int analog_init_masks(struct analog_port *port)return -1 ;if ((port->mask &3 ) !=3 && port->mask !=0xc ) { -printk (KERN_WARNING "analog.c: Unknown joystick device found " -"(data=%#x, %s), probably not analog joystick.\n" , - port->mask, port->gameport->phys); +pr_warning ("Unknown joystick device found " +"(data=%#x, %s), probably not analog joystick\n" , + port->mask, port->gameport->phys);return -1 ; }
@@ -693,8 +695,9 @@ static void analog_disconnect(struct gameport *gameport)input_unregister_device (port->analog[i].dev);gameport_close (gameport);gameport_set_drvdata (gameport,NULL ); -printk (KERN_INFO "analog.c: %d out of %d reads (%d%%) on %s failed\n" , - port->bads, port->reads, port->reads ? (port->bads *100 / port->reads) :0 , +pr_info ("%d out of %d reads (%d%%) on %s failed\n" , + port->bads, port->reads, + port->reads ? (port->bads *100 / port->reads) :0 , port->gameport->phys);kfree (port); }
@@ -738,7 +741,7 @@ static void analog_parse_options(void) analog_options[i] =0xff ;if (!strlen (js[i]))continue ; -printk (KERN_WARNING "analog.c: Bad config for port %d - \"%s\"\n" , i, js[i]); +pr_warning ("Bad config for port %d - \"%s\"\n" , i, js[i]); }for (; i <ANALOG_PORTS ; i++)
drivers/input/joystick/cobra.c +5 -2
@@ -26,6 +26,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/module.h> #include <linux/slab.h>
@@ -177,8 +179,9 @@ static int cobra_connect(struct gameport *gameport, struct gameport_driver *drv)for (i =0 ; i <2 ; i++)if ((cobra->exists >> i) & data[i] &1 ) { -printk (KERN_WARNING "cobra.c: Device %d on %s has the Ext bit set. ID is: %d" -" Contact [email protected]\n" , i, gameport->phys, (data[i] >>2 ) &7 ); +pr_warning ("Device %d on %s has the Ext bit set. ID is: %d" +" Contact [email protected]\n" , + i, gameport->phys, (data[i] >>2 ) &7 ); cobra->exists &= ~(1 << i); }
drivers/input/joystick/db9.c +9 -7
@@ -29,6 +29,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/module.h> #include <linux/delay.h>
@@ -564,7 +566,7 @@ static struct db9 __init *db9_probe(int parport, int mode)int err;if (mode <1 || mode >=DB9_MAX_PAD || !db9_modes[mode].n_buttons) { -printk (KERN_ERR "db9.c: Bad device type %d\n" , mode); +pr_err ("Bad device type %d\n" , mode); err = -EINVAL ; goto err_out; }
@@ -573,27 +575,27 @@ static struct db9 __init *db9_probe(int parport, int mode) pp =parport_find_number (parport);if (!pp) { -printk (KERN_ERR "db9.c: no such parport\n" ); +pr_err ("no such parport\n" ); err = -ENODEV ; goto err_out; }if (db9_mode->bidirectional && !(pp->modes &PARPORT_MODE_TRISTATE )) { -printk (KERN_ERR "db9.c: specified parport is not bidirectional\n" ); +pr_err ("specified parport is not bidirectional\n" ); err = -EINVAL ; goto err_put_pp; } pd =parport_register_device (pp,"db9" ,NULL ,NULL ,NULL ,PARPORT_DEV_EXCL ,NULL );if (!pd) { -printk (KERN_ERR "db9.c: parport busy already - lp.o loaded?\n" ); +pr_err ("parport busy already - lp.o loaded?\n" ); err = -EBUSY ; goto err_put_pp; } db9 =kzalloc (sizeof (struct db9 ),GFP_KERNEL );if (!db9) { -printk (KERN_ERR "db9.c: Not enough memory\n" ); +pr_err ("Not enough memory\n" ); err = -ENOMEM ; goto err_unreg_pardev; }
@@ -609,7 +611,7 @@ static struct db9 __init *db9_probe(int parport, int mode) db9->dev[i] = input_dev =input_allocate_device ();if (!input_dev) { -printk (KERN_ERR "db9.c: Not enough memory for input device\n" ); +pr_err ("Not enough memory for input device\n" ); err = -ENOMEM ; goto err_unreg_devs; }
@@ -682,7 +684,7 @@ static int __init db9_init(void)continue ;if (db9_cfg[i].nargs <2 ) { -printk (KERN_ERR "db9.c: Device type must be specified.\n" ); +pr_err ("Device type must be specified\n" ); err = -EINVAL ;break ; }
drivers/input/joystick/gf2k.c +5 -2
@@ -26,6 +26,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/delay.h> #include <linux/kernel.h> #include <linux/slab.h>
@@ -287,8 +289,9 @@ static int gf2k_connect(struct gameport *gameport, struct gameport_driver *drv)#endif if (gf2k->id >GF2K_ID_MAX || !gf2k_axes[gf2k->id]) { -printk (KERN_WARNING "gf2k.c: Not yet supported joystick on %s. [id: %d type:%s]\n" , - gameport->phys, gf2k->id, gf2k->id >GF2K_ID_MAX ?"Unknown" : gf2k_names[gf2k->id]); +pr_warning ("Not yet supported joystick on %s. [id: %d type:%s]\n" , + gameport->phys, gf2k->id, + gf2k->id >GF2K_ID_MAX ?"Unknown" : gf2k_names[gf2k->id]); err = -ENODEV ; goto fail2; }
drivers/input/joystick/grip_mp.c +9 -6
@@ -9,6 +9,8 @@* Copyright (c) 1998-2000 Vojtech Pavlik */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h>
@@ -26,9 +28,9 @@ MODULE_DESCRIPTION(DRIVER_DESC);MODULE_LICENSE ("GPL" );#ifdef GRIP_DEBUG -#define dbg(format, arg...) printk(KERN_ERR __FILE__ ": " format "\n" , ## arg) +#define dbg(format, arg...) pr_err(format "\n", ##arg)#else -#define dbg(format, arg...) do {} while (0) +#define dbg(format, arg...) do { if (0) pr_err(format "\n", ##arg); } while (0)#endif #define GRIP_MAX_PORTS 4
@@ -393,8 +395,8 @@ static int get_and_decode_packet(struct grip_mp *grip, int flags)if (!joytype) {if (port->registered) { -printk (KERN_INFO "grip_mp: removing %s, slot %d\n" , - grip_name[port->mode], slot); +pr_info ("removing %s, slot %d\n" , + grip_name[port->mode], slot);input_unregister_device (port->dev); port->registered =0 ; }
@@ -434,8 +436,9 @@ static int get_and_decode_packet(struct grip_mp *grip, int flags) {static int strange_code =0 ;if (strange_code != joytype) { -printk (KERN_INFO "Possible non-grip pad/joystick detected.\n" ); -printk (KERN_INFO "Got joy type 0x%x and packet 0x%x.\n" , joytype, packet); +pr_info ("Possible non-grip pad/joystick detected\n" ); +pr_info ("Got joy type 0x%x and packet 0x%x\n" , + joytype, packet); strange_code = joytype; } }
drivers/input/joystick/guillemot.c +8 -3
@@ -26,6 +26,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/slab.h> #include <linux/module.h>
@@ -211,8 +213,10 @@ static int guillemot_connect(struct gameport *gameport, struct gameport_driver *break ;if (!guillemot_type[i].name) { -printk (KERN_WARNING "guillemot.c: Unknown joystick on %s. [ %02x%02x:%04x, ver %d.%02d ]\n" , - gameport->phys, data[12 ], data[13 ], data[11 ], data[14 ], data[15 ]); +pr_warning ("Unknown joystick on %s. " +"[ %02x%02x:%04x, ver %d.%02d ]\n" , + gameport->phys, + data[12 ], data[13 ], data[11 ], data[14 ], data[15 ]); err = -ENODEV ; goto fail2; }
@@ -266,7 +270,8 @@ static void guillemot_disconnect(struct gameport *gameport) {struct guillemot *guillemot =gameport_get_drvdata (gameport); -printk (KERN_INFO "guillemot.c: Failed %d reads out of %d on %s\n" , guillemot->reads, guillemot->bads, guillemot->phys); +pr_info ("Failed %d reads out of %d on %s\n" , + guillemot->reads, guillemot->bads, guillemot->phys);input_unregister_device (guillemot->dev);gameport_close (gameport);kfree (guillemot);
drivers/input/joystick/iforce/iforce-packets.c +5 -3
@@ -25,6 +25,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include "iforce.h" static struct {
@@ -37,10 +39,10 @@ void iforce_dump_packet(char *msg, u16 cmd, unsigned char *data) {int i; - printk(KERN_DEBUG __FILE__ ": %s cmd = %04x, data = ", msg, cmd); + printk(KERN_DEBUG pr_fmt("%s cmd = %04x, data ="), msg, cmd);for (i =0 ; i <LO (cmd); i++) -printk ("%02x " , data[i]); -printk ("\n" ); +pr_cont (" %02x" , data[i]); +pr_cont ("\n" ); }/*
drivers/input/joystick/interact.c +5 -2
@@ -29,6 +29,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/slab.h> #include <linux/module.h>
@@ -240,8 +242,9 @@ static int interact_connect(struct gameport *gameport, struct gameport_driver *dbreak ;if (!interact_type[i].length) { -printk (KERN_WARNING "interact.c: Unknown joystick on %s. [len %d d0 %08x d1 %08x i2 %08x]\n" , - gameport->phys, i, data[0 ], data[1 ], data[2 ]); +pr_warning ("Unknown joystick on %s. " +"[len %d d0 %08x d1 %08x i2 %08x]\n" , + gameport->phys, i, data[0 ], data[1 ], data[2 ]); err = -ENODEV ; goto fail2; }
drivers/input/joystick/joydump.c +22 -18
@@ -27,6 +27,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/gameport.h> #include <linux/kernel.h>
@@ -56,34 +58,36 @@ static int joydump_connect(struct gameport *gameport, struct gameport_driver *drunsigned long flags;unsigned char u; -printk (KERN_INFO "joydump: ,------------------ START ----------------.\n" ); -printk (KERN_INFO "joydump: | Dumping: %30s |\n" , gameport->phys); -printk (KERN_INFO "joydump: | Speed: %28d kHz |\n" , gameport->speed); +pr_info (",------------------ START ----------------.\n" ); +pr_info ("| Dumping: %30s |\n" , gameport->phys); +pr_info ("| Speed: %28d kHz |\n" , gameport->speed);if (gameport_open (gameport, drv,GAMEPORT_MODE_RAW )) { -printk (KERN_INFO "joydump: | Raw mode not available - trying cooked. |\n" ); +pr_info ("| Raw mode not available - trying cooked. |\n" );if (gameport_open (gameport, drv,GAMEPORT_MODE_COOKED )) { -printk (KERN_INFO "joydump: | Cooked not available either. Failing. |\n" ); -printk (KERN_INFO "joydump: `------------------- END -----------------'\n" ); +pr_info ("| Cooked not available either. Failing. |\n" ); +pr_info ("`------------------- END -----------------'\n" );return -ENODEV ; }gameport_cooked_read (gameport, axes, &buttons);for (i =0 ; i <4 ; i++) -printk (KERN_INFO "joydump: | Axis %d: %4d. |\n" , i, axes[i]); -printk (KERN_INFO "joydump: | Buttons %02x. |\n" , buttons); -printk (KERN_INFO "joydump: `------------------- END -----------------'\n" ); +pr_info ("| Axis %d: %4d. |\n" , + i, axes[i]); +pr_info ("| Buttons %02x. |\n" , + buttons); +pr_info ("`------------------- END -----------------'\n" ); } timeout =gameport_time (gameport,10000 );/* 10 ms */ buf =kmalloc (BUF_SIZE *sizeof (struct joydump ),GFP_KERNEL );if (!buf) { -printk (KERN_INFO "joydump: no memory for testing\n" ); +pr_info ("no memory for testing\n" ); goto jd_end; } dump = buf;
@@ -123,24 +127,24 @@ static int joydump_connect(struct gameport *gameport, struct gameport_driver *dr dump = buf; prev = dump; -printk (KERN_INFO "joydump: >------------------ DATA -----------------<\n" ); -printk (KERN_INFO "joydump: | index: %3d delta: %3d us data: " ,0 ,0 ); +pr_info (">------------------ DATA -----------------<\n" ); +pr_info ("| index: %3d delta: %3d us data: " ,0 ,0 );for (j =7 ; j >=0 ; j--) -printk ("%d" , (dump->data >> j) &1 ); -printk (" |\n" ); +pr_cont ("%d" , (dump->data >> j) &1 ); +pr_cont (" |\n" ); dump++;for (i =1 ; i < t; i++, dump++, prev++) { -printk (KERN_INFO "joydump: | index: %3d delta: %3d us data: " , +pr_info ("| index: %3d delta: %3d us data: " , i, dump->time - prev->time);for (j =7 ; j >=0 ; j--) -printk ("%d" , (dump->data >> j) &1 ); -printk (" |\n" ); +pr_cont ("%d" , (dump->data >> j) &1 ); +pr_cont (" |\n" ); }kfree (buf); jd_end: -printk (KERN_INFO "joydump: `------------------- END -----------------'\n" ); +pr_info ("`------------------- END -----------------'\n" );return 0 ; }
drivers/input/joystick/sidewinder.c +32 -26
159 lines not on this page · raw message
drivers/input/joystick/spaceball.c +4 -2
@@ -30,6 +30,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/slab.h> #include <linux/module.h>
@@ -128,12 +130,12 @@ static void spaceball_process_packet(struct spaceball* spaceball)case 'E' :/* Device error */ spaceball->data[spaceball->idx -1 ] =0 ; -printk (KERN_ERR "spaceball: Device error. [%s]\n" , spaceball->data +1 ); +pr_err ("Device error. [%s]\n" , spaceball->data +1 );break ;case '?' :/* Bad command packet */ spaceball->data[spaceball->idx -1 ] =0 ; -printk (KERN_ERR "spaceball: Bad command. [%s]\n" , spaceball->data +1 ); +pr_err ("Bad command. [%s]\n" , spaceball->data +1 );break ; }
drivers/input/joystick/spaceorb.c +10 -5
@@ -29,6 +29,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/slab.h> #include <linux/module.h>
@@ -89,8 +91,8 @@ static void spaceorb_process_packet(struct spaceorb *spaceorb)case 'R' :/* Reset packet */ spaceorb->data[spaceorb->idx -1 ] =0 ;for (i =1 ; i < spaceorb->idx && spaceorb->data[i] ==' ' ; i++); -printk (KERN_INFO "input: %s [%s] is %s\n" , - dev->name, spaceorb->data + i, spaceorb->phys); +pr_info ("%s [%s] is %s\n" , + dev->name, spaceorb->data + i, spaceorb->phys);break ;case 'D' :/* Ball + button data */
@@ -117,9 +119,12 @@ static void spaceorb_process_packet(struct spaceorb *spaceorb)case 'E' :/* Error packet */ if (spaceorb->idx !=4 )return ; -printk (KERN_ERR "spaceorb: Device error. [ " ); -for (i =0 ; i <7 ; i++)if (data[1 ] & (1 << i))printk ("%s " , spaceorb_errors[i]); -printk ("]\n" ); +pr_err ("Device error. [" ); +for (i =0 ; i <7 ; i++) { +if (data[1 ] & (1 << i)) +pr_cont (" %s" , spaceorb_errors[i]); + } +pr_cont (" ]\n" );break ; }
drivers/input/joystick/turbografx.c +9 -7
@@ -29,6 +29,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/parport.h> #include <linux/input.h>
@@ -167,21 +169,21 @@ static struct tgfx __init *tgfx_probe(int parport, int *n_buttons, int n_devs) pp =parport_find_number (parport);if (!pp) { -printk (KERN_ERR "turbografx.c: no such parport\n" ); +pr_err ("no such parport\n" ); err = -EINVAL ; goto err_out; } pd =parport_register_device (pp,"turbografx" ,NULL ,NULL ,NULL ,PARPORT_DEV_EXCL ,NULL );if (!pd) { -printk (KERN_ERR "turbografx.c: parport busy already - lp.o loaded?\n" ); +pr_err ("parport busy already - lp.o loaded?\n" ); err = -EBUSY ; goto err_put_pp; } tgfx =kzalloc (sizeof (struct tgfx ),GFP_KERNEL );if (!tgfx) { -printk (KERN_ERR "turbografx.c: Not enough memory\n" ); +pr_err ("Not enough memory\n" ); err = -ENOMEM ; goto err_unreg_pardev; }
@@ -197,14 +199,14 @@ static struct tgfx __init *tgfx_probe(int parport, int *n_buttons, int n_devs)continue ;if (n_buttons[i] >6 ) { -printk (KERN_ERR "turbografx.c: Invalid number of buttons %d\n" , n_buttons[i]); +pr_err ("Invalid number of buttons %d\n" , n_buttons[i]); err = -EINVAL ; goto err_unreg_devs; } tgfx->dev[i] = input_dev =input_allocate_device ();if (!input_dev) { -printk (KERN_ERR "turbografx.c: Not enough memory for input device\n" ); +pr_err ("Not enough memory for input device\n" ); err = -ENOMEM ; goto err_unreg_devs; }
@@ -240,7 +242,7 @@ static struct tgfx __init *tgfx_probe(int parport, int *n_buttons, int n_devs) }if (!tgfx->sticks) { -printk (KERN_ERR "turbografx.c: No valid devices specified\n" ); +pr_err ("No valid devices specified\n" ); err = -EINVAL ; goto err_free_tgfx; }
@@ -285,7 +287,7 @@ static int __init tgfx_init(void)continue ;if (tgfx_cfg[i].nargs <2 ) { -printk (KERN_ERR "turbografx.c: at least one joystick must be specified\n" ); +pr_err ("at least one joystick must be specified\n" ); err = -EINVAL ;break ; }
drivers/input/joystick/walkera0701.c +4 -2
@@ -12,6 +12,8 @@* the Free Software Foundation. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +/* #define WK0701_DEBUG */ #define RESERVE 20000
@@ -108,7 +110,7 @@ static inline void walkera0701_parse_frame(struct walkera_dev *w) magic = (w->buf[21 ] <<4 ) | w->buf[22 ]; magic_bit = (w->buf[24 ] &8 ) >>3 ; printk(KERN_DEBUG -"walkera0701: %4d %4d %4d %4d %4d %4d %4d %4d (magic %2x %d)\n" , + pr_fmt("%4d %4d %4d %4d %4d %4d %4d %4d (magic %2x %d)\n"), val1, val2, val3, val4, val5, val6, val7, val8, magic, magic_bit); }
@@ -207,7 +209,7 @@ static int walkera0701_connect(struct walkera_dev *w, int parport)return -ENODEV ;if (w->parport->irq ==-1 ) { -printk (KERN_ERR "walkera0701: parport without interrupt\n" ); +pr_err ("parport without interrupt\n" ); goto init_err; }
drivers/input/joystick/xpad.c +3 -1
@@ -73,6 +73,8 @@* Later changes can be tracked in SCM. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/init.h> #include <linux/slab.h>
@@ -1001,7 +1003,7 @@ static int __init usb_xpad_init(void) {int result =usb_register (&xpad_driver);if (result ==0 ) - printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_DESC "\n"); +pr_info (DRIVER_DESC "\n" );return result; }
Signature · 1 line
1.7.2.19.g9a302
PATCH 3/9 drivers/input/keyboard: Use pr_fmt and pr_<level>
In reply to Dmitry TorokhovMove error messages from array to direct uses.
Convert bare printks to pr_cont
--- drivers/input/keyboard/amikbd.c | 42 ++++++++++++++++------- drivers/input/keyboard/atakbd.c | 4 ++- drivers/input/keyboard/hil_kbd.c | 21 +++++------- drivers/input/keyboard/hilkbd.c | 26 ++++++++------- drivers/input/keyboard/jornada680_kbd.c | 5 ++- drivers/input/keyboard/jornada720_kbd.c | 10 +++-- drivers/input/keyboard/lkkbd.c | 54 +++++++++++++++---------------- drivers/input/keyboard/locomokbd.c | 6 ++- drivers/input/keyboard/newtonkbd.c | 4 ++- drivers/input/keyboard/omap-keypad.c | 25 +++++++------- drivers/input/keyboard/sunkbd.c | 9 +++-- drivers/input/keyboard/xtkbd.c | 7 +++- 12 files changed, 119 insertions(+), 94 deletions(-)
drivers/input/keyboard/amikbd.c +29 -13
@@ -29,6 +29,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/init.h> #include <linux/input.h>
@@ -144,17 +146,6 @@ static unsigned char amikbd_keycode[0x78] __initdata = { [103] = KEY_RIGHTMETA }; -static const char *amikbd_messages[8 ] = { - [0 ] =KERN_ALERT "amikbd: Ctrl-Amiga-Amiga reset warning!!\n" , - [1 ] =KERN_WARNING "amikbd: keyboard lost sync\n" , - [2 ] =KERN_WARNING "amikbd: keyboard buffer overflow\n" , - [3 ] =KERN_WARNING "amikbd: keyboard controller failure\n" , - [4 ] =KERN_ERR "amikbd: keyboard selftest failure\n" , - [5 ] =KERN_INFO "amikbd: initiate power-up key stream\n" , - [6 ] =KERN_INFO "amikbd: terminate power-up key stream\n" , - [7 ] =KERN_WARNING "amikbd: keyboard interrupt\n" -}; -static irqreturn_t amikbd_interrupt (int irq,void *data) {struct input_dev *dev = data;
@@ -177,8 +168,33 @@ static irqreturn_t amikbd_interrupt(int irq, void *data) }input_sync (dev); - }else /* scancodes >= 0x78 are error codes */ -printk (amikbd_messages[scancode -0x78 ]); + }else {/* scancodes >= 0x78 are error codes */ +switch (scancode) { +case 0x78 : +pr_alert ("Ctrl-Amiga-Amiga reset warning!!\n" ); +break ; +case 0x79 : +pr_warning ("keyboard lost sync\n" ); +break ; +case 0x7a : +pr_warning ("keyboard buffer overflow\n" ); +break ; +case 0x7b : +pr_warning ("keyboard controller failure\n" ); +break ; +case 0x7c : +pr_err ("keyboard selftest failure\n" ); +break ; +case 0x7d : +pr_info ("initiate power-up key stream\n" ); +break ; +case 0x7e : +pr_info ("terminate power-up key stream\n" ); +break ; +case 0x7f : +pr_warning ("keyboard interrupt\n" ); +break ; + }return IRQ_HANDLED ; }
drivers/input/keyboard/atakbd.c +3 -1
@@ -40,6 +40,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/init.h> #include <linux/input.h>
@@ -210,7 +212,7 @@ static void atakbd_interrupt(unsigned char scancode, char down)input_sync (atakbd_dev); } }else /* scancodes >= 0xf2 are mouse data, most likely */ -printk (KERN_INFO "atakbd: unhandled scancode %x\n" , scancode); +pr_info ("unhandled scancode %x\n" , scancode);return ; }
drivers/input/keyboard/hil_kbd.c +9 -12
@@ -31,6 +31,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/hil.h> #include <linux/input.h> #include <linux/serio.h>
@@ -131,7 +133,7 @@ static void hil_dev_handle_command_response(struct hil_dev *dev)/* These occur when device isn't present */ if (p != (HIL_ERR_INT |HIL_PKT_CMD )) {/* Anything else we'd like to know about. */ - printk(KERN_WARNING PREFIX "Device sent unknown record %x\n", p); +pr_warning ("Device sent unknown record %x\n" , p); } goto out; }
@@ -212,8 +214,7 @@ static void hil_dev_handle_ptr_events(struct hil_dev *ptr)bool absdev, ax16;if ((p &HIL_CMDCT_POL ) != idx -1 ) { - printk(KERN_WARNING PREFIX - "Malformed poll packet %x (idx = %i)\n", p, idx); +pr_warning ("Malformed poll packet %x (idx = %i)\n" , p, idx);return ; }
@@ -267,7 +268,7 @@ static void hil_dev_handle_ptr_events(struct hil_dev *ptr)static void hil_dev_process_err (struct hil_dev *dev) { - printk(KERN_WARNING PREFIX "errored HIL packet\n"); +pr_warning ("errored HIL packet\n" ); dev->idx4 =0 ;complete (&dev->cmd_done);/* just in case somebody is waiting */ }
@@ -347,7 +348,7 @@ static void hil_dev_keyboard_setup(struct hil_dev *kbd) input_dev->name =strlen (kbd->rnm) ? kbd->rnm :"HIL keyboard" ; input_dev->phys ="hpkbd/input0" ; - printk(KERN_INFO PREFIX "HIL keyboard found (did = 0x%02x, lang = %s)\n", +pr_info ("HIL keyboard found (did = 0x%02x, lang = %s)\n" , did, hil_language[did &HIL_IDD_DID_TYPE_KB_LANG_MASK ]); }
@@ -433,11 +434,8 @@ static void hil_dev_pointer_setup(struct hil_dev *ptr) input_dev->name =strlen (ptr->rnm) ? ptr->rnm :"HIL pointer device" ; - printk(KERN_INFO PREFIX -"HIL pointer device found (did: 0x%02x, axis: %s)\n" , - did, txt); - printk(KERN_INFO PREFIX -"HIL pointer has %i buttons and %i sets of %i axes\n" , +pr_info ("HIL pointer device found (did: 0x%02x, axis: %s)\n" , did, txt); +pr_info ("HIL pointer has %i buttons and %i sets of %i axes\n" , ptr->nbtn, naxsets, ptr->naxes); }
@@ -511,8 +509,7 @@ static int hil_dev_connect(struct serio *serio, struct serio_driver *drv)case HIL_IDD_DID_TYPE_CHAR :if (HIL_IDD_NUM_BUTTONS (idd) ||HIL_IDD_NUM_AXES_PER_SET (*idd)) { - printk(KERN_INFO PREFIX - "combo devices are not supported.\n"); +pr_info ("combo devices are not supported\n" ); goto bail1; }
drivers/input/keyboard/hilkbd.c +14 -12
@@ -15,6 +15,8 @@* archive for more details. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/pci_ids.h> #include <linux/ioport.h> #include <linux/module.h>
@@ -219,7 +221,7 @@ static int __devinit hil_keyb_init(void) err =request_irq (HIL_IRQ , hil_interrupt,0 ,"hil" , hil_dev.dev_id);if (err) { -printk (KERN_ERR "HIL: Can't get IRQ\n" ); +pr_err ("Can't get IRQ\n" ); goto err1; }
@@ -232,16 +234,16 @@ static int __devinit hil_keyb_init(void)wait_event_interruptible_timeout (hil_wait, hil_dev.valid,3 *HZ );if (!hil_dev.valid) -printk (KERN_WARNING "HIL: timed out, assuming no keyboard present\n" ); +pr_warning ("timed out, assuming no keyboard present\n" ); c = hil_dev.c; hil_dev.valid =0 ;if (c ==0 ) { kbid =-1 ; -printk (KERN_WARNING "HIL: no keyboard present\n" ); +pr_warning ("no keyboard present\n" ); }else { kbid =ffz (~c); -printk (KERN_INFO "HIL: keyboard found at id %d\n" , kbid); +pr_info ("keyboard found at id %d\n" , kbid); }/* set it to raw mode */
@@ -268,12 +270,12 @@ static int __devinit hil_keyb_init(void) err =input_register_device (hil_dev.dev);if (err) { -printk (KERN_ERR "HIL: Can't register device\n" ); +pr_err ("Can't register device\n" ); goto err2; } -printk (KERN_INFO "input: %s, ID %d at 0x%08lx (irq %d) found and attached\n" , - hil_dev.dev->name, kbid,HILBASE ,HIL_IRQ ); +pr_info ("%s, ID %d at 0x%08lx (irq %d) found and attached\n" , + hil_dev.dev->name, kbid,HILBASE ,HIL_IRQ );return 0 ;
@@ -306,8 +308,8 @@ static int __devinit hil_probe_chip(struct parisc_device *dev)return -ENODEV ;if (!dev->irq) { -printk (KERN_WARNING "HIL: IRQ not found for HIL bus at 0x%p\n" , - (void *)dev->hpa.start); +pr_warning ("IRQ not found for HIL bus at 0x%p\n" , + (void *)dev->hpa.start);return -ENODEV ; }
@@ -315,7 +317,7 @@ static int __devinit hil_probe_chip(struct parisc_device *dev) hil_irq = dev->irq; hil_dev.dev_id = dev; -printk (KERN_INFO "Found HIL bus at 0x%08lx, IRQ %d\n" , hil_base, hil_irq); +pr_info ("Found HIL bus at 0x%08lx, IRQ %d\n" , hil_base, hil_irq);return hil_keyb_init (); }
@@ -368,12 +370,12 @@ static int __init hil_init(void)return -ENODEV ;if (!hwreg_present ((void *)(HILBASE +HIL_DATA ))) { -printk (KERN_ERR "HIL: hardware register was not found\n" ); +pr_err ("hardware register was not found\n" );return -ENODEV ; }if (!request_region (HILBASE +HIL_DATA ,2 ,"hil" )) { -printk (KERN_ERR "HIL: IOPORT region already used\n" ); +pr_err ("IOPORT region already used\n" );return -EIO ; }
drivers/input/keyboard/jornada680_kbd.c +3 -2
@@ -16,6 +16,8 @@* published by the Free Software Foundation. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/init.h> #include <linux/input.h> #include <linux/input-polldev.h>
@@ -231,8 +233,7 @@ static int __devinit jornada680kbd_probe(struct platform_device *pdev)return 0 ; failed: -printk (KERN_ERR "Jornadakbd: failed to register driver, error: %d\n" , - error); +pr_err ("failed to register driver, error: %d\n" , error);platform_set_drvdata (pdev,NULL );input_free_polled_device (poll_dev);kfree (jornadakbd);
drivers/input/keyboard/jornada720_kbd.c +6 -4
@@ -15,6 +15,9 @@* published by the Free Software Foundation. * */ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/device.h> #include <linux/errno.h> #include <linux/interrupt.h>
@@ -67,9 +70,8 @@ static irqreturn_t jornada720_kbd_interrupt(int irq, void *dev_id)if (jornada_ssp_inout (GETSCANKEYCODE ) !=TXDUMMY ) { printk(KERN_DEBUG -"jornada720_kbd: " -"GetKeycode command failed with ETIMEDOUT, " -"flushed bus\n" ); + pr_fmt("GetKeycode command failed with ETIMEDOUT, " + "flushed bus\n")); }else {/* How many keycodes are waiting for us? */ count =jornada_ssp_byte (TXDUMMY );
@@ -132,7 +134,7 @@ static int __devinit jornada720_kbd_probe(struct platform_device *pdev)IRQF_DISABLED |IRQF_TRIGGER_FALLING , "jornadakbd", pdev);if (err) { -printk (KERN_INFO "jornadakbd720_kbd: Unable to grab IRQ\n" ); +pr_info ("Unable to grab IRQ\n" ); goto fail1; }
drivers/input/keyboard/lkkbd.c +26 -28
129 lines not on this page · raw message
drivers/input/keyboard/locomokbd.c +4 -2
@@ -23,6 +23,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/slab.h> #include <linux/module.h> #include <linux/init.h>
@@ -254,7 +256,7 @@ static int __devinit locomokbd_probe(struct locomo_dev *dev) dev->length, LOCOMO_DRIVER_NAME(dev))) { err = -EBUSY ; -printk (KERN_ERR "locomokbd: Can't acquire access to io memory for keyboard\n" ); +pr_err ("Can't acquire access to io memory for keyboard\n" ); goto err_free_mem; }
@@ -299,7 +301,7 @@ static int __devinit locomokbd_probe(struct locomo_dev *dev)/* attempt to get the interrupt */ err =request_irq (dev->irq[0 ], locomokbd_interrupt,0 ,"locomokbd" , locomokbd);if (err) { -printk (KERN_ERR "locomokbd: Can't get irq for keyboard\n" ); +pr_err ("Can't get irq for keyboard\n" ); goto err_release_region; }
drivers/input/keyboard/newtonkbd.c +3 -1
@@ -26,6 +26,8 @@* Justin Cormack, 68 Dartmouth Park Road, London NW5 1SN, UK. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/slab.h> #include <linux/module.h> #include <linux/input.h>
@@ -76,7 +78,7 @@ static irqreturn_t nkbd_interrupt(struct serio *serio, }else if (data ==0xe7 )/* end of init sequence */ -printk (KERN_INFO "input: %s on %s\n" , nkbd->dev->name, serio->phys); +pr_info ("%s on %s\n" , nkbd->dev->name, serio->phys);return IRQ_HANDLED ; }
drivers/input/keyboard/omap-keypad.c +12 -13
@@ -24,6 +24,8 @@* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/init.h> #include <linux/interrupt.h>
@@ -195,15 +197,14 @@ static void omap_kp_tasklet(unsigned long data)if (!(changed & (1 << row)))continue ;#ifdef NEW_BOARD_LEARNING_MODE -printk (KERN_INFO "omap-keypad: key %d-%d %s\n" , col, - row, (new_state[col] & (1 << row)) ? -"pressed" :"released" ); +pr_info ("key %d-%d %s\n" , + col, row, (new_state[col] & (1 << row)) ? +"pressed" :"released" );#else key =omap_kp_find_key (col, row);if (key <0 ) { -printk (KERN_WARNING -"omap-keypad: Spurious key event %d-%d\n" , - col, row); +pr_warning ("Spurious key event %d-%d\n" , + col, row);/* We scan again after a couple of seconds */ spurious =1 ;continue ;
@@ -300,7 +301,7 @@ static int __devinit omap_kp_probe(struct platform_device *pdev)int i, col_idx, row_idx, irq_idx, ret;if (!pdata->rows || !pdata->cols || !pdata->keymap) { -printk (KERN_ERR "No rows, cols or keymap from pdata\n" ); +pr_err ("No rows, cols or keymap from pdata\n" );return -EINVAL ; }
@@ -340,8 +341,7 @@ static int __devinit omap_kp_probe(struct platform_device *pdev)/* Cols: outputs */ for (col_idx =0 ; col_idx < omap_kp->cols; col_idx++) {if (gpio_request (col_gpios[col_idx],"omap_kp_col" ) <0 ) { -printk (KERN_ERR "Failed to request" -"GPIO%d for keypad\n" , +pr_err ("Failed to request GPIO%d for keypad\n" , col_gpios[col_idx]); goto err1; }
@@ -350,8 +350,7 @@ static int __devinit omap_kp_probe(struct platform_device *pdev)/* Rows: inputs */ for (row_idx =0 ; row_idx < omap_kp->rows; row_idx++) {if (gpio_request (row_gpios[row_idx],"omap_kp_row" ) <0 ) { -printk (KERN_ERR "Failed to request" -"GPIO%d for keypad\n" , +pr_err ("Failed to request GPIO%d for keypad\n" , row_gpios[row_idx]); goto err2; }
@@ -387,7 +386,7 @@ static int __devinit omap_kp_probe(struct platform_device *pdev) ret =input_register_device (omap_kp->input);if (ret <0 ) { -printk (KERN_ERR "Unable to register omap-keypad input device\n" ); +pr_err ("Unable to register omap-keypad input device\n" ); goto err3; }
@@ -478,7 +477,7 @@ static struct platform_driver omap_kp_driver = {static int __init omap_kp_init (void ) { -printk (KERN_INFO "OMAP Keypad Driver\n" ); +pr_info ("OMAP Keypad Driver\n" );return platform_driver_register (&omap_kp_driver); }
drivers/input/keyboard/sunkbd.c +5 -4
@@ -26,6 +26,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/delay.h> #include <linux/sched.h> #include <linux/slab.h>
@@ -137,10 +139,9 @@ static irqreturn_t sunkbd_interrupt(struct serio *serio, !(data & SUNKBD_RELEASE));input_sync (sunkbd->dev); }else { -printk (KERN_WARNING -"sunkbd.c: Unknown key (scancode %#x) %s.\n" , - data &SUNKBD_KEY , - data &SUNKBD_RELEASE ?"released" :"pressed" ); +pr_warning ("Unknown key (scancode %#x) %s.\n" , + data &SUNKBD_KEY , + data &SUNKBD_RELEASE ?"released" :"pressed" ); } } out:
drivers/input/keyboard/xtkbd.c +5 -2
@@ -26,6 +26,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/slab.h> #include <linux/module.h> #include <linux/input.h>
@@ -76,8 +78,9 @@ static irqreturn_t xtkbd_interrupt(struct serio *serio,input_report_key (xtkbd->dev, xtkbd->keycode[data &XTKBD_KEY ], !(data &XTKBD_RELEASE ));input_sync (xtkbd->dev); }else { -printk (KERN_WARNING "xtkbd.c: Unknown key (scancode %#x) %s.\n" , - data &XTKBD_KEY , data &XTKBD_RELEASE ?"released" :"pressed" ); +pr_warning ("Unknown key (scancode %#x) %s\n" , + data &XTKBD_KEY , + data &XTKBD_RELEASE ?"released" :"pressed" ); } }return IRQ_HANDLED ;
Signature · 1 line
1.7.2.19.g9a302
PATCH 4/9 drivers/input/misc: Use pr_fmt and pr_<level>
In reply to Dmitry TorokhovFixup #define dbginfo
Remove #define err, use pr_err
--- drivers/input/misc/ati_remote.c | 22 ++++++++++++---------- drivers/input/misc/ati_remote2.c | 6 ++++-- drivers/input/misc/cm109.c | 23 +++++++++-------------- drivers/input/misc/hp_sdc_rtc.c | 10 ++++++---- drivers/input/misc/m68kspkr.c | 4 +++- drivers/input/misc/powermate.c | 19 +++++++++++-------- drivers/input/misc/uinput.c | 25 ++++++++++++++----------- drivers/input/misc/winbond-cir.c | 6 ++++-- drivers/input/misc/wistron_btns.c | 29 +++++++++++++++-------------- drivers/input/misc/yealink.c | 5 +++-- 10 files changed, 81 insertions(+), 68 deletions(-)
drivers/input/misc/ati_remote.c +12 -10
@@ -85,6 +85,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h>
@@ -139,9 +141,11 @@ static int repeat_delay = REPEAT_DELAY;module_param (repeat_delay, int,0644 );MODULE_PARM_DESC (repeat_delay,"Delay before sending repeats, default = 500 msec" ); -#define dbginfo(dev, format, arg...) do { if (debug) dev_info(dev , format , ## arg); } while (0) -#undef err -#define err(format, arg...) printk(KERN_ERR format , ## arg) +#define dbginfo(dev, format, arg...) \ +do { \ + if (debug) \ + dev_info(dev, format, ##arg); \ +} while (0)static struct usb_device_id ati_remote_table[] = { {USB_DEVICE (ATI_REMOTE_VENDOR_ID ,LOLA_REMOTE_PRODUCT_ID ) },
@@ -738,7 +742,7 @@ static int ati_remote_probe(struct usb_interface *interface, const struct usb_deint err = -ENOMEM ;if (iface_host->desc.bNumEndpoints !=2 ) { -err ("%s: Unexpected desc.bNumEndpoints\n" , __func__); +pr_err ("%s: Unexpected desc.bNumEndpoints\n" , __func__);return -ENODEV ; }
@@ -746,11 +750,11 @@ static int ati_remote_probe(struct usb_interface *interface, const struct usb_de endpoint_out = &iface_host->endpoint[1 ].desc;if (!usb_endpoint_is_int_in (endpoint_in)) { -err ("%s: Unexpected endpoint_in\n" , __func__); +pr_err ("%s: Unexpected endpoint_in\n" , __func__);return -ENODEV ; }if (le16_to_cpu (endpoint_in->wMaxPacketSize) ==0 ) { -err ("%s: endpoint_in message size==0? \n" , __func__); +pr_err ("%s: endpoint_in message size==0?\n" , __func__);return -ENODEV ; }
@@ -838,11 +842,9 @@ static int __init ati_remote_init(void) result =usb_register (&ati_remote_driver);if (result) - printk(KERN_ERR KBUILD_MODNAME -": usb_register error #%d\n" , result); +pr_err ("usb_register error #%d\n" , result);else - printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" -DRIVER_DESC "\n" ); +pr_info (DRIVER_VERSION ":" DRIVER_DESC "\n" );return result; }
drivers/input/misc/ati_remote2.c +4 -2
@@ -9,6 +9,8 @@* as published by the Free Software Foundation. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/usb/input.h> #include <linux/slab.h>
@@ -975,9 +977,9 @@ static int __init ati_remote2_init(void) r =usb_register (&ati_remote2_driver);if (r) -printk (KERN_ERR "ati_remote2: usb_register() = %d\n" , r); +pr_err ("usb_register() = %d\n" , r);else -printk (KERN_INFO "ati_remote2: " DRIVER_DESC " " DRIVER_VERSION "\n" ); +pr_info (DRIVER_DESC " " DRIVER_VERSION "\n" );return r; }
drivers/input/misc/cm109.c +9 -14
@@ -28,6 +28,8 @@* - Read/write EEPROM */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/init.h> #include <linux/slab.h>
@@ -518,8 +520,7 @@ static int cm109_input_open(struct input_dev *idev) error =usb_autopm_get_interface (dev->intf);if (error <0 ) { -err ("%s - cannot autoresume, result %d" , - __func__, error); +err ("%s: cannot autoresume, result %d" , __func__, error);return error; }
@@ -855,23 +856,18 @@ static int __init cm109_select_keymap(void)/* Load the phone keymap */ if (!strcasecmp (phone,"kip1000" )) { keymap = keymap_kip1000; - printk(KERN_INFO KBUILD_MODNAME ": " - "Keymap for Komunikate KIP1000 phone loaded\n"); +pr_info ("Keymap for Komunikate KIP1000 phone loaded\n" ); }else if (!strcasecmp (phone,"gtalk" )) { keymap = keymap_gtalk; - printk(KERN_INFO KBUILD_MODNAME ": " - "Keymap for Genius G-talk phone loaded\n"); +pr_info ("Keymap for Genius G-talk phone loaded\n" ); }else if (!strcasecmp (phone,"usbph01" )) { keymap = keymap_usbph01; - printk(KERN_INFO KBUILD_MODNAME ": " - "Keymap for Allied-Telesis Corega USBPH01 phone loaded\n"); +pr_info ("Keymap for Allied-Telesis Corega USBPH01 phone loaded\n" ); }else if (!strcasecmp (phone,"atcom" )) { keymap = keymap_atcom; - printk(KERN_INFO KBUILD_MODNAME ": " - "Keymap for ATCom AU-100 phone loaded\n"); +pr_info ("Keymap for ATCom AU-100 phone loaded\n" ); }else { - printk(KERN_ERR KBUILD_MODNAME ": " - "Unsupported phone: %s\n", phone); +pr_err ("Unsupported phone: %s\n" , phone);return -EINVAL ; }
@@ -890,8 +886,7 @@ static int __init cm109_init(void)if (err)return err; - printk(KERN_INFO KBUILD_MODNAME ": " - DRIVER_DESC ": " DRIVER_VERSION " (C) " DRIVER_AUTHOR "\n"); +pr_info (DRIVER_DESC ": " DRIVER_VERSION " (C) " DRIVER_AUTHOR "\n" );return 0 ; }
drivers/input/misc/hp_sdc_rtc.c +6 -4
@@ -33,6 +33,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/hp_sdc.h> #include <linux/errno.h> #include <linux/types.h>
@@ -703,13 +705,13 @@ static int __init hp_sdc_rtc_init(void)if ((ret =hp_sdc_request_timer_irq (&hp_sdc_rtc_isr)))return ret;if (misc_register (&hp_sdc_rtc_dev) !=0 ) -printk (KERN_INFO "Could not register misc. dev for i8042 rtc\n" ); +pr_info ("Could not register misc. dev for i8042 rtc\n" );create_proc_read_entry ("driver/rtc" ,0 ,NULL , hp_sdc_rtc_read_proc,NULL ); -printk (KERN_INFO "HP i8042 SDC + MSM-58321 RTC support loaded " -"(RTC v " RTC_VERSION ")\n" ); +pr_info ("HP i8042 SDC + MSM-58321 RTC support loaded " +"(RTC v " RTC_VERSION ")\n" );return 0 ; }
@@ -719,7 +721,7 @@ static void __exit hp_sdc_rtc_exit(void)remove_proc_entry ("driver/rtc" ,NULL );misc_deregister (&hp_sdc_rtc_dev);hp_sdc_release_timer_irq (hp_sdc_rtc_isr); -printk (KERN_INFO "HP i8042 SDC + MSM-58321 RTC support unloaded\n" ); +pr_info ("HP i8042 SDC + MSM-58321 RTC support unloaded\n" ); }module_init (hp_sdc_rtc_init);
drivers/input/misc/m68kspkr.c +3 -1
@@ -13,6 +13,8 @@* the Free Software Foundation */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h>
@@ -113,7 +115,7 @@ static int __init m68kspkr_init(void)int err;if (!mach_beep) { -printk (KERN_INFO "m68kspkr: no lowlevel beep support\n" ); +pr_info ("no lowlevel beep support\n" );return -ENODEV ; }
drivers/input/misc/powermate.c +11 -8
@@ -28,6 +28,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/slab.h> #include <linux/module.h>
@@ -167,12 +169,12 @@ static void powermate_sync_state(struct powermate_device *pm) pm->configcr->wIndex =cpu_to_le16 ( pm->static_brightness ); pm->requires_update &= ~UPDATE_STATIC_BRIGHTNESS ; }else { -printk (KERN_ERR "powermate: unknown update required" ); +pr_err ("unknown update required\n" ); pm->requires_update =0 ;/* fudge the bug */ return ; } -/* printk("powermate: %04x %04x\n", pm->configcr->wValue, pm->configcr->wIndex); */ +/* pr_info("%04x %04x\n", pm->configcr->wValue, pm->configcr->wIndex); */ pm->configcr->bRequestType =0x41 ;/* vendor request */ pm->configcr->bRequest =0x01 ;
@@ -183,7 +185,7 @@ static void powermate_sync_state(struct powermate_device *pm) powermate_config_complete, pm);if (usb_submit_urb (pm->config,GFP_ATOMIC )) -printk (KERN_ERR "powermate: usb_submit_urb(config) failed" ); +pr_err ("usb_submit_urb(config) failed\n" ); }/* Called when our asynchronous control message completes. We may need to issue another immediately */
@@ -193,7 +195,7 @@ static void powermate_config_complete(struct urb *urb)unsigned long flags;if (urb->status) -printk (KERN_ERR "powermate: config urb returned %d\n" , urb->status); +pr_err ("config urb returned %d\n" , urb->status);spin_lock_irqsave (&pm->lock, flags);powermate_sync_state (pm);
@@ -346,8 +348,8 @@ static int powermate_probe(struct usb_interface *intf, const struct usb_device_ibreak ;default : input_dev->name = pm_name_soundknob; -printk (KERN_WARNING "powermate: unknown product id %04x\n" , -le16_to_cpu (udev->descriptor.idProduct)); +pr_warning ("unknown product id %04x\n" , +le16_to_cpu (udev->descriptor.idProduct)); } input_dev->phys = pm->phys;
@@ -369,8 +371,9 @@ static int powermate_probe(struct usb_interface *intf, const struct usb_device_i maxp =usb_maxpacket (udev, pipe,usb_pipeout (pipe));if (maxp <POWERMATE_PAYLOAD_SIZE_MIN || maxp >POWERMATE_PAYLOAD_SIZE_MAX ) { -printk (KERN_WARNING "powermate: Expected payload of %d--%d bytes, found %d bytes!\n" , -POWERMATE_PAYLOAD_SIZE_MIN ,POWERMATE_PAYLOAD_SIZE_MAX , maxp); +pr_warning ("Expected payload of %d--%d bytes, found %d bytes!\n" , +POWERMATE_PAYLOAD_SIZE_MIN , +POWERMATE_PAYLOAD_SIZE_MAX , maxp); maxp =POWERMATE_PAYLOAD_SIZE_MAX ; }
drivers/input/misc/uinput.c +14 -11
@@ -29,6 +29,9 @@* 0.1 20/06/2002 * - first public version */ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/poll.h> #include <linux/sched.h> #include <linux/slab.h>
@@ -246,7 +249,7 @@ static int uinput_create_device(struct uinput_device *udev)int error;if (udev->state !=UIST_SETUP_COMPLETE ) { -printk (KERN_DEBUG "%s: write device info first\n" ,UINPUT_NAME ); + printk(KERN_DEBUG pr_fmt("write device info first\n"));return -EINVAL ; }
@@ -306,10 +309,10 @@ static int uinput_validate_absbits(struct input_dev *dev)if (input_abs_get_max (dev, cnt) <=input_abs_get_min (dev, cnt)) { printk(KERN_DEBUG -"%s: invalid abs[%02x] min:%d max:%d\n" , -UINPUT_NAME , cnt, -input_abs_get_min (dev, cnt), -input_abs_get_max (dev, cnt)); + pr_fmt("invalid abs[%02x] min:%d max:%d\n"), + cnt, +input_abs_get_min (dev, cnt), + input_abs_get_max(dev, cnt)); retval = -EINVAL ;break ; }
@@ -317,12 +320,12 @@ static int uinput_validate_absbits(struct input_dev *dev)if (input_abs_get_flat (dev, cnt) >input_abs_get_max (dev, cnt) -input_abs_get_min (dev, cnt)) { printk(KERN_DEBUG -"%s: abs_flat #%02x out of range: %d " -"(min:%d/max:%d)\n" , -UINPUT_NAME , cnt, -input_abs_get_flat (dev, cnt), -input_abs_get_min (dev, cnt), -input_abs_get_max (dev, cnt)); + pr_fmt("abs_flat #%02x out of range: %d " + "(min:%d/max:%d)\n"), + cnt, +input_abs_get_flat (dev, cnt), +input_abs_get_min (dev, cnt), + input_abs_get_max(dev, cnt)); retval = -EINVAL ;break ; }
drivers/input/misc/winbond-cir.c +4 -2
@@ -44,6 +44,8 @@* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/pnp.h> #include <linux/interrupt.h>
@@ -1581,13 +1583,13 @@ wbcir_init(void)case IR_PROTOCOL_RC6 :break ;default : - printk(KERN_ERR DRVNAME ": Invalid protocol argument\n"); +pr_err ("Invalid protocol argument\n" );return -EINVAL ; } ret =pnp_register_driver (&wbcir_driver);if (ret) - printk(KERN_ERR DRVNAME ": Unable to register driver\n"); +pr_err ("Unable to register driver\n" );return ret; }
drivers/input/misc/wistron_btns.c +15 -14
@@ -17,6 +17,9 @@* with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place Suite 330, Boston, MA 02111-1307, USA. */ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/io.h> #include <linux/dmi.h> #include <linux/init.h>
@@ -111,15 +114,15 @@ static int __init map_bios(void) base =ioremap (0xF0000 ,0x10000 );/* Can't fail */ offset =locate_wistron_bios (base);if (offset <0 ) { -printk (KERN_ERR "wistron_btns: BIOS entry point not found\n" ); +pr_err ("BIOS entry point not found\n" );iounmap (base);return -ENODEV ; } entry_point =readl (base + offset +5 ); printk(KERN_DEBUG -"wistron_btns: BIOS signature found at %p, entry point %08X\n" , - base + offset, entry_point); + pr_fmt("BIOS signature found at %p, entry point %08X\n"), + base + offset, entry_point);if (entry_point >=0xF0000 ) { bios_code_map_base = base;
@@ -128,9 +131,8 @@ static int __init map_bios(void)iounmap (base); bios_code_map_base =ioremap (entry_point & ~0x3FFF ,0x4000 );if (bios_code_map_base ==NULL ) { -printk (KERN_ERR -"wistron_btns: Can't map BIOS code at %08X\n" , - entry_point & ~0x3FFF ); +pr_err ("Can't map BIOS code at %08X\n" , + entry_point & ~0x3FFF ); goto err; } bios_entry_point = bios_code_map_base + (entry_point &0x3FFF );
@@ -138,7 +140,7 @@ static int __init map_bios(void)/* The Windows driver maps 0x10000 bytes, we keep only one page... */ bios_data_map_base =ioremap (0x400 ,0xc00 );if (bios_data_map_base ==NULL ) { -printk (KERN_ERR "wistron_btns: Can't map BIOS data\n" ); +pr_err ("Can't map BIOS data\n" ); goto err_code; }return 0 ;
@@ -1006,13 +1008,13 @@ static int __init select_keymap(void)else if (strcmp (keymap_name,"generic" ) ==0 ) keymap = keymap_wistron_generic;else { -printk (KERN_ERR "wistron_btns: Keymap unknown\n" ); +pr_err ("Keymap unknown\n" );return -EINVAL ; } }if (keymap ==NULL ) {if (!force) { -printk (KERN_ERR "wistron_btns: System unknown\n" ); +pr_err ("System unknown\n" );return -ENODEV ; } keymap = keymap_empty;
@@ -1132,8 +1134,7 @@ static void handle_key(u8 code) } jiffies_last_press = jiffies; }else -printk (KERN_NOTICE -"wistron_btns: Unknown key code %02X\n" , code); +pr_notice ("Unknown key code %02X\n" , code); }static void poll_bios (bool discard)
@@ -1190,9 +1191,9 @@ static int __devinit wistron_setup_keymap(struct input_dev *dev,case KE_END :if (entry->code &FE_UNTESTED ) -printk (KERN_WARNING "Untested laptop multimedia keys, " -"please report success or failure to " -"[email protected]\n" ); +pr_warning ("Untested laptop multimedia keys, " +"please report success or failure to " +"[email protected]\n" );break ; }
drivers/input/misc/yealink.c +3 -2
@@ -46,6 +46,8 @@* 20050816 henk Merge 2.6.13-rc6 */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/init.h> #include <linux/slab.h>
@@ -992,8 +994,7 @@ static int __init yealink_dev_init(void) {int ret =usb_register (&yealink_driver);if (ret ==0 ) - printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" -DRIVER_DESC "\n" ); +pr_info (DRIVER_VERSION ":" DRIVER_DESC "\n" );return ret; }
Signature · 1 line
1.7.2.19.g9a302
PATCH 5/9 drivers/input/mouse: Use pr_fmt and pr_<level>
In reply to Dmitry Torokhovps2 related drivers use #define pr_fmt(fmt) KBUILD_BASENAME ": " fmt all others use #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Add argument checking to dbg macro
Convert bare printks to pr_cont
--- drivers/input/mouse/alps.c | 12 ++++--- drivers/input/mouse/appletouch.c | 64 +++++++++++++++++------------------ drivers/input/mouse/bcm5974.c | 48 +++++++++++++-------------- drivers/input/mouse/elantech.c | 4 +- drivers/input/mouse/inport.c | 8 +++-- drivers/input/mouse/lifebook.c | 5 ++- drivers/input/mouse/logibm.c | 10 +++-- drivers/input/mouse/logips2pp.c | 13 ++++--- drivers/input/mouse/pc110pad.c | 10 +++-- drivers/input/mouse/psmouse-base.c | 52 +++++++++++++++-------------- drivers/input/mouse/rpcmouse.c | 4 ++- drivers/input/mouse/sentelic.c | 13 ++++--- drivers/input/mouse/sermouse.c | 6 ++- drivers/input/mouse/synaptics.c | 30 +++++++++-------- drivers/input/mouse/trackpoint.c | 10 +++--- drivers/input/mouse/vsxxxaa.c | 44 ++++++++++++------------- 16 files changed, 174 insertions(+), 159 deletions(-)
drivers/input/mouse/alps.c +7 -5
@@ -15,6 +15,8 @@* the Free Software Foundation. */ +#define pr_fmt (fmt) KBUILD_BASENAME ": " fmt +#include <linux/slab.h> #include <linux/input.h> #include <linux/serio.h>
@@ -25,9 +27,9 @@#undef DEBUG#ifdef DEBUG -#define dbg(format, arg...) printk(KERN_INFO "alps.c: " format "\n", ## arg) +#define dbg(format, arg...) pr_info(format "\n", ##arg)#else -#define dbg(format, arg...) do {} while (0) +#define dbg(format, arg...) do { if (0) pr_info(format "\n", ##arg); } while (0)#endif #define ALPS_OLDPROTO 0x01/* old style input */
@@ -605,12 +607,12 @@ static int alps_hw_init(struct psmouse *psmouse) }if (alps_tap_mode (psmouse, true)) { -printk (KERN_WARNING "alps.c: Failed to enable hardware tapping\n" ); +pr_warning ("Failed to enable hardware tapping\n" );return -1 ; }if (alps_absolute_mode (psmouse)) { -printk (KERN_ERR "alps.c: Failed to enable absolute mode\n" ); +pr_err ("Failed to enable absolute mode\n" );return -1 ; }
@@ -621,7 +623,7 @@ static int alps_hw_init(struct psmouse *psmouse)/* ALPS needs stream mode, otherwise it won't report any data */ if (ps2_command (&psmouse->ps2dev,NULL ,PSMOUSE_CMD_SETSTREAM )) { -printk (KERN_ERR "alps.c: Failed to enable stream mode\n" ); +pr_err ("Failed to enable stream mode\n" );return -1 ; }
drivers/input/mouse/appletouch.c +31 -33
149 lines not on this page · raw message
drivers/input/mouse/bcm5974.c +23 -25
148 lines not on this page · raw message
drivers/input/mouse/elantech.c +2 -2
@@ -171,8 +171,8 @@ static void elantech_packet_dump(unsigned char *packet, int size) printk(KERN_DEBUG pr_fmt("PS/2 packet [")); for (i = 0; i < size; i++) - printk("%s0x%02x ", (i) ? ", " : " ", packet[i]); - printk("]\n"); + pr_cont(" 0x%02x", packet[i]); + pr_cont(" ]\n"); }/*
drivers/input/mouse/inport.c +5 -3
@@ -32,6 +32,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/ioport.h> #include <linux/init.h>
@@ -133,7 +135,7 @@ static int __init inport_init(void)int err;if (!request_region (INPORT_BASE ,INPORT_EXTENT ,"inport" )) { -printk (KERN_ERR "inport.c: Can't allocate ports at %#x\n" ,INPORT_BASE ); +pr_err ("Can't allocate ports at %#x\n" ,INPORT_BASE );return -EBUSY ; }
@@ -141,14 +143,14 @@ static int __init inport_init(void) b =inb (INPORT_SIGNATURE_PORT ); c =inb (INPORT_SIGNATURE_PORT );if (a == b || a != c) { -printk (KERN_INFO "inport.c: Didn't find InPort mouse at %#x\n" ,INPORT_BASE ); +pr_info ("Didn't find InPort mouse at %#x\n" ,INPORT_BASE ); err = -ENODEV ; goto err_release_region; } inport_dev =input_allocate_device ();if (!inport_dev) { -printk (KERN_ERR "inport.c: Not enough memory for input device\n" ); +pr_err ("Not enough memory for input device\n" ); err = -ENOMEM ; goto err_release_region; }
drivers/input/mouse/lifebook.c +3 -2
@@ -12,6 +12,8 @@* the Free Software Foundation. */ +#define pr_fmt (fmt) KBUILD_BASENAME ": " fmt +#include <linux/input.h> #include <linux/serio.h> #include <linux/libps2.h>
@@ -169,8 +171,7 @@ static psmouse_ret_t lifebook_process_byte(struct psmouse *psmouse)if (relative_packet) {if (!dev2) -printk (KERN_WARNING "lifebook.c: got relative packet " -"but no relative device set up\n" ); +pr_warning ("got relative packet but no relative device set up\n" ); }else {if (lifebook_use_6byte_proto) { input_report_abs(dev1, ABS_X,
drivers/input/mouse/logibm.c +6 -4
@@ -33,6 +33,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/delay.h> #include <linux/ioport.h>
@@ -104,7 +106,7 @@ static irqreturn_t logibm_interrupt(int irq, void *dev_id)static int logibm_open (struct input_dev *dev) {if (request_irq (logibm_irq, logibm_interrupt,0 ,"logibm" ,NULL )) { -printk (KERN_ERR "logibm.c: Can't allocate irq %d\n" , logibm_irq); +pr_err ("Can't allocate irq %d\n" , logibm_irq);return -EBUSY ; }outb (LOGIBM_ENABLE_IRQ ,LOGIBM_CONTROL_PORT );
@@ -122,7 +124,7 @@ static int __init logibm_init(void)int err;if (!request_region (LOGIBM_BASE ,LOGIBM_EXTENT ,"logibm" )) { -printk (KERN_ERR "logibm.c: Can't allocate ports at %#x\n" ,LOGIBM_BASE ); +pr_err ("Can't allocate ports at %#x\n" ,LOGIBM_BASE );return -EBUSY ; }
@@ -131,7 +133,7 @@ static int __init logibm_init(void)udelay (100 );if (inb (LOGIBM_SIGNATURE_PORT ) !=LOGIBM_SIGNATURE_BYTE ) { -printk (KERN_INFO "logibm.c: Didn't find Logitech busmouse at %#x\n" ,LOGIBM_BASE ); +pr_info ("Didn't find Logitech busmouse at %#x\n" ,LOGIBM_BASE ); err = -ENODEV ; goto err_release_region; }
@@ -141,7 +143,7 @@ static int __init logibm_init(void) logibm_dev =input_allocate_device ();if (!logibm_dev) { -printk (KERN_ERR "logibm.c: Not enough memory for input device\n" ); +pr_err ("Not enough memory for input device\n" ); err = -ENOMEM ; goto err_release_region; }
drivers/input/mouse/logips2pp.c +7 -6
@@ -9,6 +9,8 @@* the Free Software Foundation. */ +#define pr_fmt (fmt) KBUILD_BASENAME ": " fmt +#include <linux/input.h> #include <linux/serio.h> #include <linux/libps2.h>
@@ -84,8 +86,8 @@ static psmouse_ret_t ps2pp_process_byte(struct psmouse *psmouse)#ifdef DEBUG default : -printk (KERN_WARNING "psmouse.c: Received PS2++ packet #%x, but don't know how to handle.\n" , - (packet[1 ] >>4 ) | (packet[0 ] &0x30 )); +pr_warning ("Received PS2++ packet #%x, but don't know how to handle\n" , + (packet[1 ] >>4 ) | (packet[0 ] &0x30 ));#endif } }else {
@@ -382,7 +384,7 @@ int ps2pp_init(struct psmouse *psmouse, bool set_properties) } }else { -printk (KERN_WARNING "logips2pp: Detected unknown logitech mouse model %d\n" , model); +pr_warning ("Detected unknown logitech mouse model %d\n" , model); }if (set_properties) {
@@ -400,9 +402,8 @@ int ps2pp_init(struct psmouse *psmouse, bool set_properties) error =device_create_file (&psmouse->ps2dev.serio->dev, &psmouse_attr_smartscroll.dattr);if (error) { -printk (KERN_ERR -"logips2pp.c: failed to create smartscroll " -"sysfs attribute, error: %d\n" , error); +pr_err ("failed to create smartscroll sysfs attribute, error: %d\n" , + error);return -1 ; } }
drivers/input/mouse/pc110pad.c +6 -4
@@ -29,6 +29,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h>
@@ -114,22 +116,22 @@ static int __init pc110pad_init(void)return -ENODEV ;if (!request_region (pc110pad_io,4 ,"pc110pad" )) { -printk (KERN_ERR "pc110pad: I/O area %#x-%#x in use.\n" , - pc110pad_io, pc110pad_io +4 ); +pr_err ("I/O area %#x-%#x in use\n" , + pc110pad_io, pc110pad_io +4 );return -EBUSY ; }outb (PC110PAD_OFF , pc110pad_io +2 );if (request_irq (pc110pad_irq, pc110pad_interrupt,0 ,"pc110pad" ,NULL )) { -printk (KERN_ERR "pc110pad: Unable to get irq %d.\n" , pc110pad_irq); +pr_err ("Unable to get irq %d\n" , pc110pad_irq); err = -EBUSY ; goto err_release_region; } pc110pad_dev =input_allocate_device ();if (!pc110pad_dev) { -printk (KERN_ERR "pc110pad: Not enough memory.\n" ); +pr_err ("Not enough memory\n" ); err = -ENOMEM ; goto err_free_irq; }
drivers/input/mouse/psmouse-base.c +27 -25
137 lines not on this page · raw message
drivers/input/mouse/rpcmouse.c +3 -1
@@ -17,6 +17,8 @@* the complete state and then work out if something has changed. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/ptrace.h> #include <linux/interrupt.h>
@@ -87,7 +89,7 @@ static int __init rpcmouse_init(void) rpcmouse_lasty = (short )iomd_readl (IOMD_MOUSEY );if (request_irq (IRQ_VSYNCPULSE , rpcmouse_irq,IRQF_SHARED ,"rpcmouse" , rpcmouse_dev)) { -printk (KERN_ERR "rpcmouse: unable to allocate VSYNC interrupt\n" ); +pr_err ("unable to allocate VSYNC interrupt\n" ); err = -EBUSY ; goto err_free_dev; }
drivers/input/mouse/sentelic.c +8 -5
@@ -19,6 +19,8 @@* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#define pr_fmt (fmt) KBUILD_BASENAME ": " fmt +#include <linux/module.h> #include <linux/version.h> #include <linux/input.h>
@@ -608,11 +610,13 @@ static void fsp_packet_debug(unsigned char packet[]) ps2_packet_cnt++; jiffies_msec =jiffies_to_msecs (jiffies); -printk (KERN_DEBUG "%08dms PS/2 packets: %02x, %02x, %02x, %02x\n" , - jiffies_msec, packet[0 ], packet[1 ], packet[2 ], packet[3 ]); + printk(KERN_DEBUG + pr_fmt("%08dms PS/2 packets: %02x, %02x, %02x, %02x\n"), + jiffies_msec, packet[0], packet[1], packet[2], packet[3]);if (jiffies_msec - ps2_last_second >1000 ) { -printk (KERN_DEBUG "PS/2 packets/sec = %d\n" , ps2_packet_cnt); + printk(KERN_DEBUG pr_fmt("PS/2 packets/sec = %d\n"), + ps2_packet_cnt); ps2_packet_cnt =0 ; ps2_last_second = jiffies_msec; }
@@ -821,8 +825,7 @@ int fsp_init(struct psmouse *psmouse)return -ENODEV ; } -printk (KERN_INFO -"Finger Sensing Pad, hw: %d.%d.%d, sw: %s, buttons: %d\n" , +pr_info ("Finger Sensing Pad, hw: %d.%d.%d, sw: %s, buttons: %d\n" , ver >>4 , ver &0x0F , rev, fsp_drv_ver, buttons &7 ); psmouse->private = priv =kzalloc (sizeof (struct fsp_data ),GFP_KERNEL );
drivers/input/mouse/sermouse.c +4 -2
@@ -26,6 +26,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/delay.h> #include <linux/module.h> #include <linux/slab.h>
@@ -186,8 +188,8 @@ static void sermouse_process_ms(struct sermouse *sermouse, signed char data)default :/* We don't decode anything else yet. */ -printk (KERN_WARNING -"sermouse.c: Received MZ++ packet %x, don't know how to handle.\n" , buf[1 ]); +pr_warning ("Received MZ++ packet %x, don't know how to handle\n" , + buf[1 ]);break ; }
drivers/input/mouse/synaptics.c +16 -14
@@ -23,6 +23,8 @@* Trademarks are the property of their respective owners. */ +#define pr_fmt (fmt) KBUILD_BASENAME ": " fmt +#include <linux/module.h> #include <linux/dmi.h> #include <linux/input.h>
@@ -157,7 +159,7 @@ static int synaptics_capability(struct psmouse *psmouse)if (SYN_EXT_CAP_REQUESTS (priv->capabilities) >=1 ) {if (synaptics_send_cmd (psmouse,SYN_QUE_EXT_CAPAB , cap)) { -printk (KERN_ERR "Synaptics claims to have extended capabilities," +pr_err ("Synaptics claims to have extended capabilities," " but I'm not able to read them.\n" ); }else { priv->ext_cap = (cap[0 ] <<16 ) | (cap[1 ] <<8 ) | cap[2 ];
@@ -173,7 +175,7 @@ static int synaptics_capability(struct psmouse *psmouse)if (SYN_EXT_CAP_REQUESTS (priv->capabilities) >=4 ) {if (synaptics_send_cmd (psmouse,SYN_QUE_EXT_CAPAB_0C , cap)) { -printk (KERN_ERR "Synaptics claims to have extended capability 0x0c," +pr_err ("Synaptics claims to have extended capability 0x0c," " but I'm not able to read it.\n" ); }else { priv->ext_cap_0c = (cap[0 ] <<16 ) | (cap[1 ] <<8 ) | cap[2 ];
@@ -223,7 +225,7 @@ static int synaptics_resolution(struct psmouse *psmouse)if (SYN_EXT_CAP_REQUESTS (priv->capabilities) >=5 &&SYN_CAP_MAX_DIMENSIONS (priv->ext_cap_0c)) {if (synaptics_send_cmd (psmouse,SYN_QUE_EXT_DIMENSIONS , max)) { -printk (KERN_ERR "Synaptics claims to have dimensions query," +pr_err ("Synaptics claims to have dimensions query," " but I'm not able to read it.\n" ); }else { priv->x_max = (max[0 ] <<5 ) | ((max[1 ] &0x0f ) <<1 );
@@ -327,7 +329,7 @@ static void synaptics_pt_activate(struct psmouse *psmouse) priv->mode &= ~SYN_BIT_FOUR_BYTE_CLIENT ;if (synaptics_mode_cmd (psmouse, priv->mode)) -printk (KERN_INFO "synaptics: failed to switch guest protocol\n" ); +pr_info ("failed to switch guest protocol\n" ); } }
@@ -337,7 +339,7 @@ static void synaptics_pt_create(struct psmouse *psmouse) serio =kzalloc (sizeof (struct serio ),GFP_KERNEL );if (!serio) { -printk (KERN_ERR "synaptics: not enough memory to allocate pass-through port\n" ); +pr_err ("not enough memory to allocate pass-through port\n" );return ; }
@@ -349,7 +351,7 @@ static void synaptics_pt_create(struct psmouse *psmouse) psmouse->pt_activate = synaptics_pt_activate; -printk (KERN_INFO "serio: %s port at %s\n" , serio->name, psmouse->phys); +pr_info ("%s port at %s\n" , serio->name, psmouse->phys);serio_register_port (serio); }
@@ -552,7 +554,7 @@ static int synaptics_validate_byte(unsigned char packet[], int idx, unsigned chareturn (packet[idx] & oldabs_mask[idx]) == oldabs_rslt[idx];default : -printk (KERN_ERR "synaptics: unknown packet type %d\n" , pkt_type); +pr_err ("unknown packet type %d\n" , pkt_type);return 0 ; } }
@@ -563,7 +565,7 @@ static unsigned char synaptics_detect_pkt_type(struct psmouse *psmouse)for (i =0 ; i <5 ; i++)if (!synaptics_validate_byte (psmouse->packet, i,SYN_NEWABS_STRICT )) { -printk (KERN_INFO "synaptics: using relaxed packet validation\n" ); +pr_info ("using relaxed packet validation\n" );return SYN_NEWABS_RELAXED ; }
@@ -663,7 +665,7 @@ static int synaptics_reconnect(struct psmouse *psmouse)return -1 ;if (synaptics_query_hardware (psmouse)) { -printk (KERN_ERR "Unable to query Synaptics hardware.\n" ); +pr_err ("Unable to query Synaptics hardware\n" );return -1 ; }
@@ -674,7 +676,7 @@ static int synaptics_reconnect(struct psmouse *psmouse)return -1 ;if (synaptics_set_absolute_mode (psmouse)) { -printk (KERN_ERR "Unable to initialize Synaptics hardware.\n" ); +pr_err ("Unable to initialize Synaptics hardware\n" );return -1 ; }
@@ -736,18 +738,18 @@ int synaptics_init(struct psmouse *psmouse)psmouse_reset (psmouse);if (synaptics_query_hardware (psmouse)) { -printk (KERN_ERR "Unable to query Synaptics hardware.\n" ); +pr_err ("Unable to query Synaptics hardware\n" ); goto init_fail; }if (synaptics_set_absolute_mode (psmouse)) { -printk (KERN_ERR "Unable to initialize Synaptics hardware.\n" ); +pr_err ("Unable to initialize Synaptics hardware\n" ); goto init_fail; } priv->pkt_type =SYN_MODEL_NEWABS (priv->model_id) ?SYN_NEWABS :SYN_OLDABS ; -printk (KERN_INFO "Synaptics Touchpad, model: %ld, fw: %ld.%ld, id: %#lx, caps: %#lx/%#lx/%#lx\n" , +pr_info ("Synaptics Touchpad, model: %ld, fw: %ld.%ld, id: %#lx, caps: %#lx/%#lx/%#lx\n" ,SYN_ID_MODEL (priv->identity),SYN_ID_MAJOR (priv->identity),SYN_ID_MINOR (priv->identity), priv->model_id, priv->capabilities, priv->ext_cap, priv->ext_cap_0c);
@@ -782,7 +784,7 @@ int synaptics_init(struct psmouse *psmouse)* thye same as rate of standard PS/2 mouse. */ if (psmouse->rate >=80 && impaired_toshiba_kbc) { -printk (KERN_INFO "synaptics: Toshiba %s detected, limiting rate to 40pps.\n" , +pr_info ("Toshiba %s detected, limiting rate to 40pps\n" ,dmi_get_system_info (DMI_PRODUCT_NAME )); psmouse->rate =40 ; }
drivers/input/mouse/trackpoint.c +5 -5
@@ -8,6 +8,8 @@* Trademarks are the property of their respective owners. */ +#define pr_fmt (fmt) KBUILD_BASENAME ": " fmt +#include <linux/slab.h> #include <linux/delay.h> #include <linux/serio.h>
@@ -297,7 +299,7 @@ int trackpoint_detect(struct psmouse *psmouse, bool set_properties)return 0 ;if (trackpoint_read (&psmouse->ps2dev,TP_EXT_BTN , &button_info)) { -printk (KERN_WARNING "trackpoint.c: failed to get extended button data\n" ); +pr_warning ("failed to get extended button data\n" ); button_info =0 ; }
@@ -319,15 +321,13 @@ int trackpoint_detect(struct psmouse *psmouse, bool set_properties) error =sysfs_create_group (&ps2dev->serio->dev.kobj, &trackpoint_attr_group);if (error) { -printk (KERN_ERR -"trackpoint.c: failed to create sysfs attributes, error: %d\n" , - error); +pr_err ("failed to create sysfs attributes, error: %d\n" , error);kfree (psmouse->private); psmouse->private =NULL ;return -1 ; } -printk (KERN_INFO "IBM TrackPoint firmware: 0x%02x, buttons: %d/%d\n" , +pr_info ("IBM TrackPoint firmware: 0x%02x, buttons: %d/%d\n" , firmware_id, (button_info &0xf0 ) >>4 , button_info &0x0f );return 0 ;
drivers/input/mouse/vsxxxaa.c +21 -23
114 lines not on this page · raw message
Signature · 1 line
1.7.2.19.g9a302
PATCH 6/9 drivers/input/serio: Use pr_fmt and pr_<level>
In reply to Dmitry TorokhovAdd argument checking to #define dbg
--- drivers/input/serio/ambakmi.c | 5 ++- drivers/input/serio/ct82c710.c | 10 +++-- drivers/input/serio/gscps2.c | 15 ++++---- drivers/input/serio/hil_mlc.c | 17 ++++----- drivers/input/serio/hp_sdc.c | 53 ++++++++++++++-------------- drivers/input/serio/hp_sdc_mlc.c | 45 +++++++++++++----------- drivers/input/serio/i8042-x86ia64io.h | 43 ++++++++++------------ drivers/input/serio/i8042.c | 62 +++++++++++++++------------------ drivers/input/serio/i8042.h | 21 +++++++---- drivers/input/serio/maceps2.c | 5 ++- drivers/input/serio/parkbd.c | 8 +++-- drivers/input/serio/q40kbd.c | 6 ++- drivers/input/serio/rpckbd.c | 6 ++- drivers/input/serio/sa1111ps2.c | 17 +++++---- drivers/input/serio/serio_raw.c | 10 +++-- drivers/input/serio/serport.c | 6 ++- 16 files changed, 175 insertions(+), 154 deletions(-)
drivers/input/serio/ambakmi.c +4 -1
@@ -9,6 +9,9 @@* the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/init.h> #include <linux/serio.h>
@@ -82,7 +85,7 @@ static int amba_kmi_open(struct serio *io) ret =request_irq (kmi->irq, amba_kmi_int,0 ,"kmi-pl050" , kmi);if (ret) { -printk (KERN_ERR "kmi: failed to claim IRQ%d\n" , kmi->irq); +pr_err ("failed to claim IRQ%d\n" , kmi->irq);writeb (0 ,KMICR ); goto clk_disable; }
drivers/input/serio/ct82c710.c +6 -4
@@ -26,6 +26,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/delay.h> #include <linux/module.h> #include <linux/ioport.h>
@@ -98,12 +100,12 @@ static int ct82c170_wait(void)static void ct82c710_close (struct serio *serio) {if (ct82c170_wait ()) -printk (KERN_WARNING "ct82c710.c: Device busy in close()\n" ); +pr_warning ("Device busy in close()\n" );outb_p (inb_p (CT82C710_STATUS ) & ~(CT82C710_ENABLE |CT82C710_INTS_ON ),CT82C710_STATUS );if (ct82c170_wait ()) -printk (KERN_WARNING "ct82c710.c: Device busy in close()\n" ); +pr_warning ("Device busy in close()\n" );free_irq (CT82C710_IRQ ,NULL ); }
@@ -127,7 +129,7 @@ static int ct82c710_open(struct serio *serio)outb_p (status,CT82C710_STATUS );/* Enable interrupts */ while (ct82c170_wait ()) { -printk (KERN_ERR "ct82c710: Device busy in open()\n" ); +pr_err ("Device busy in open()\n" ); status &= ~(CT82C710_ENABLE |CT82C710_INTS_ON );outb_p (status,CT82C710_STATUS );free_irq (CT82C710_IRQ ,NULL );
@@ -239,7 +241,7 @@ static int __init ct82c710_init(void)serio_register_port (ct82c710_port); -printk (KERN_INFO "serio: C&T 82c710 mouse port at %#llx irq %d\n" , +pr_info ("C&T 82c710 mouse port at %#llx irq %d\n" , (unsigned long long )CT82C710_DATA ,CT82C710_IRQ );return 0 ;
drivers/input/serio/gscps2.c +8 -7
@@ -22,6 +22,8 @@* was usable/enabled ?) */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/init.h> #include <linux/module.h> #include <linux/slab.h>
@@ -42,8 +44,6 @@ MODULE_DESCRIPTION("HP GSC PS2 port driver");MODULE_LICENSE ("GPL" );MODULE_DEVICE_TABLE (parisc, gscps2_device_tbl); -#define PFX "gscps2.c: " -/* * Driver constants */
@@ -151,7 +151,8 @@ static inline int gscps2_writeb_output(struct gscps2port *ps2port, u8 data)char *addr = ps2port->addr;if (!wait_TBE (addr)) { - printk(KERN_DEBUG PFX "timeout - could not write byte %#x\n", data); + printk(KERN_DEBUG pr_fmt("timeout - could not write byte %#x\n"), + data);return 0 ; }
@@ -287,7 +288,7 @@ static int gscps2_write(struct serio *port, unsigned char data)struct gscps2port *ps2port = port->port_data;if (!gscps2_writeb_output (ps2port, data)) { - printk(KERN_DEBUG PFX "sending byte %#x failed.\n", data); + printk(KERN_DEBUG pr_fmt("sending byte %#x failed\n"), data);return -1 ; }return 0 ;
@@ -373,8 +374,8 @@ static int __devinit gscps2_probe(struct parisc_device *dev) goto fail_miserably;if (ps2port->id !=GSC_ID_KEYBOARD && ps2port->id !=GSC_ID_MOUSE ) { - printk(KERN_WARNING PFX "Unsupported PS/2 port at 0x%08lx (id=%d) ignored\n", - hpa, ps2port->id); +pr_warning ("Unsupported PS/2 port at 0x%08lx (id=%d) ignored\n" , + hpa, ps2port->id); ret = -ENODEV ; goto fail; }
@@ -384,7 +385,7 @@ static int __devinit gscps2_probe(struct parisc_device *dev) goto fail;#endif - printk(KERN_INFO "serio: %s port at 0x%p irq %d @ %s\n", + pr_info("%s port at 0x%p irq %d @ %s\n", ps2port->port->name, ps2port->addr, ps2port->padev->irq,
drivers/input/serio/hil_mlc.c +8 -9
@@ -52,6 +52,8 @@* and to initiate probes of the loop for new devices. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/hil_mlc.h> #include <linux/errno.h> #include <linux/kernel.h>
@@ -69,8 +71,6 @@ MODULE_LICENSE("Dual BSD/GPL");EXPORT_SYMBOL (hil_mlc_register);EXPORT_SYMBOL (hil_mlc_unregister); -#define PREFIX "HIL MLC: " -static LIST_HEAD (hil_mlcs);static DEFINE_RWLOCK (hil_mlcs_lock);static struct timer_list hil_mlcs_kicker;
@@ -248,7 +248,7 @@ static int hilse_match(hil_mlc *mlc, int unused) goto err;#ifdef HIL_MLC_DEBUG - printk(KERN_DEBUG PREFIX "new in slot %i\n", rc); + printk(KERN_DEBUG pr_fmt("new in slot %i\n"), rc);#endif hil_mlc_copy_di_scratch (mlc, rc); mlc->di_map[mlc->ddi] = rc;
@@ -260,14 +260,14 @@ static int hilse_match(hil_mlc *mlc, int unused) mlc->di_map[mlc->ddi] = rc;#ifdef HIL_MLC_DEBUG - printk(KERN_DEBUG PREFIX "same in slot %i\n", rc); + printk(KERN_DEBUG pr_fmt("same in slot %i\n"), rc);#endif mlc->serio_map[rc].di_revmap = mlc->ddi;hil_mlc_clean_serio_map (mlc);return 0 ; err: - printk(KERN_ERR PREFIX "Residual device slots exhausted, close some serios!\n"); +pr_err ("Residual device slots exhausted, close some serios!\n" );return 1 ; }
@@ -419,8 +419,7 @@ static int hilse_take_rnm(hil_mlc *mlc, int unused) mlc->di_scratch.rnm[i] = mlc->ipacket[i] &HIL_PKT_DATA_MASK ; - printk(KERN_INFO PREFIX "Device name gotten: %16s\n", - mlc->di_scratch.rnm); +pr_info ("Device name gotten: %16s\n" , mlc->di_scratch.rnm);return 0 ; }
@@ -626,7 +625,7 @@ static int hilse_donode(hil_mlc *mlc)#ifdef HIL_MLC_DEBUG if (mlc->seidx && mlc->seidx != seidx && mlc->seidx !=41 && mlc->seidx !=42 && mlc->seidx !=43 ) { - printk(KERN_DEBUG PREFIX "z%i \n {%i}", doze, mlc->seidx); + printk(KERN_DEBUG pr_fmt("z%i\n {%i}\n"), doze, mlc->seidx); doze =0 ; }
@@ -776,7 +775,7 @@ static void hil_mlcs_process(unsigned long unused)if (mlc->seidx !=41 && mlc->seidx !=42 && mlc->seidx !=43 ) - printk(KERN_DEBUG PREFIX " + "); + printk(KERN_DEBUG pr_fmt(" + "));#endif } }
drivers/input/serio/hp_sdc.c +26 -27
164 lines not on this page · raw message
drivers/input/serio/hp_sdc_mlc.c +24 -21
121 lines not on this page · raw message
drivers/input/serio/i8042-x86ia64io.h +20 -23
88 lines not on this page · raw message
drivers/input/serio/i8042.c +28 -34
196 lines not on this page · raw message
drivers/input/serio/i8042.h +14 -7
@@ -89,15 +89,22 @@#ifdef DEBUG static unsigned long i8042_start_time;#define dbg_init () do { i8042_start_time = jiffies; } while (0) -#define dbg(format, arg...) \ - do { \ - if (i8042_debug) \ - printk(KERN_DEBUG __FILE__ ": " format " [%d]\n" , \ - ## arg, (int) (jiffies - i8042_start_time)); \ - } while (0) +#define dbg(format, arg...) \ +do { \ + if (i8042_debug) \ + printk(KERN_DEBUG pr_fmt(format " [%d]\n"), \ + ##arg, \ + (int)(jiffies - i8042_start_time)); \ +} while (0)#else #define dbg_init () do { } while (0) -#define dbg(format, arg...) do {} while (0) +#define dbg(format, arg...) \ +do { \ + if (0) \ + printk(KERN_DEBUG pr_fmt(format " [%d]\n"), \ + ##arg, \ + (int)(jiffies - i8042_start_time)); \ +} while (0)#endif #endif /* _I8042_H */
drivers/input/serio/maceps2.c +4 -1
@@ -7,6 +7,9 @@* it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation */ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/init.h> #include <linux/serio.h>
@@ -91,7 +94,7 @@ static int maceps2_open(struct serio *dev)struct maceps2_data *data = (struct maceps2_data *)dev->port_data;if (request_irq (data->irq, maceps2_interrupt,0 ,"PS2 port" , dev)) { -printk (KERN_ERR "Could not allocate PS/2 IRQ\n" ); +pr_err ("Could not allocate PS/2 IRQ\n" );return -EBUSY ; }
drivers/input/serio/parkbd.c +5 -3
@@ -44,6 +44,8 @@* with 300 mA power reqirement of a typical AT keyboard. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/parport.h> #include <linux/slab.h>
@@ -148,7 +150,7 @@ static int parkbd_getport(void) pp =parport_find_number (parkbd_pp_no);if (pp ==NULL ) { -printk (KERN_ERR "parkbd: no such parport\n" ); +pr_err ("no such parport\n" );return -ENODEV ; }
@@ -201,8 +203,8 @@ static int __init parkbd_init(void)serio_register_port (parkbd_port); -printk (KERN_INFO "serio: PARKBD %s adapter on %s\n" , - parkbd_mode ?"AT" :"XT" , parkbd_dev->port->name); +pr_info ("PARKBD %s adapter on %s\n" , + parkbd_mode ?"AT" :"XT" , parkbd_dev->port->name);return 0 ; }
drivers/input/serio/q40kbd.c +4 -2
@@ -29,6 +29,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/init.h> #include <linux/serio.h>
@@ -95,7 +97,7 @@ static int q40kbd_open(struct serio *port)q40kbd_flush ();if (request_irq (Q40_IRQ_KEYBOARD , q40kbd_interrupt,0 ,"q40kbd" ,NULL )) { -printk (KERN_ERR "q40kbd.c: Can't get irq %d.\n" ,Q40_IRQ_KEYBOARD ); +pr_err ("Can't get irq %d\n" ,Q40_IRQ_KEYBOARD );return -EBUSY ; }
@@ -129,7 +131,7 @@ static int __devinit q40kbd_probe(struct platform_device *dev)strlcpy (q40kbd_port->phys,"Q40" ,sizeof (q40kbd_port->phys));serio_register_port (q40kbd_port); -printk (KERN_INFO "serio: Q40 kbd registered\n" ); +pr_info ("Q40 kbd registered\n" );return 0 ; }
drivers/input/serio/rpckbd.c +4 -2
@@ -27,6 +27,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/interrupt.h> #include <linux/init.h>
@@ -84,12 +86,12 @@ static int rpckbd_open(struct serio *port)iomd_readb (IOMD_KARTRX );if (request_irq (IRQ_KEYBOARDRX , rpckbd_rx,0 ,"rpckbd" , port) !=0 ) { -printk (KERN_ERR "rpckbd.c: Could not allocate keyboard receive IRQ\n" ); +pr_err ("Could not allocate keyboard receive IRQ\n" );return -EBUSY ; }if (request_irq (IRQ_KEYBOARDTX , rpckbd_tx,0 ,"rpckbd" , port) !=0 ) { -printk (KERN_ERR "rpckbd.c: Could not allocate keyboard transmit IRQ\n" ); +pr_err ("Could not allocate keyboard transmit IRQ\n" );free_irq (IRQ_KEYBOARDRX ,NULL );return -EBUSY ; }
drivers/input/serio/sa1111ps2.c +10 -7
@@ -7,6 +7,9 @@* it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License. */ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/init.h> #include <linux/input.h>
@@ -129,16 +132,16 @@ static int ps2_open(struct serio *io) ret =request_irq (ps2if->dev->irq[0 ], ps2_rxint,0 ,SA1111_DRIVER_NAME (ps2if->dev), ps2if);if (ret) { -printk (KERN_ERR "sa1111ps2: could not allocate IRQ%d: %d\n" , - ps2if->dev->irq[0 ], ret); +pr_err ("could not allocate IRQ%d: %d\n" , + ps2if->dev->irq[0 ], ret);return ret; } ret =request_irq (ps2if->dev->irq[1 ], ps2_txint,0 ,SA1111_DRIVER_NAME (ps2if->dev), ps2if);if (ret) { -printk (KERN_ERR "sa1111ps2: could not allocate IRQ%d: %d\n" , - ps2if->dev->irq[1 ], ret); +pr_err ("could not allocate IRQ%d: %d\n" , + ps2if->dev->irq[1 ], ret);free_irq (ps2if->dev->irq[0 ], ps2if);return ret; }
@@ -204,19 +207,19 @@ static int __devinit ps2_test(struct ps2if *ps2if) stat =ps2_test_one (ps2if,PS2CR_FKC );if (stat !=PS2STAT_KBD ) { -printk ("PS/2 interface test failed[1]: %02x\n" , stat); +pr_info ("PS/2 interface test failed[1]: %02x\n" , stat); ret = -ENODEV ; } stat =ps2_test_one (ps2if,0 );if (stat != (PS2STAT_KBC |PS2STAT_KBD )) { -printk ("PS/2 interface test failed[2]: %02x\n" , stat); +pr_info ("PS/2 interface test failed[2]: %02x\n" , stat); ret = -ENODEV ; } stat =ps2_test_one (ps2if,PS2CR_FKD );if (stat !=PS2STAT_KBC ) { -printk ("PS/2 interface test failed[3]: %02x\n" , stat); +pr_info ("PS/2 interface test failed[3]: %02x\n" , stat); ret = -ENODEV ; }
drivers/input/serio/serio_raw.c +6 -4
@@ -9,6 +9,8 @@* the Free Software Foundation. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/sched.h> #include <linux/slab.h> #include <linux/smp_lock.h>
@@ -276,7 +278,7 @@ static int serio_raw_connect(struct serio *serio, struct serio_driver *drv)int err;if (!(serio_raw =kzalloc (sizeof (struct serio_raw ),GFP_KERNEL ))) { -printk (KERN_ERR "serio_raw.c: can't allocate memory for a device\n" ); +pr_err ("can't allocate memory for a device\n" );return -ENOMEM ; }
@@ -308,12 +310,12 @@ static int serio_raw_connect(struct serio *serio, struct serio_driver *drv) }if (err) { -printk (KERN_INFO "serio_raw: failed to register raw access device for %s\n" , +pr_info ("failed to register raw access device for %s\n" , serio->phys); goto out_close; } -printk (KERN_INFO "serio_raw: raw access enabled on %s (%s, minor %d)\n" , +pr_info ("raw access enabled on %s (%s, minor %d)\n" , serio->phys, serio_raw->name, serio_raw->dev.minor); goto out;
@@ -334,7 +336,7 @@ static int serio_raw_reconnect(struct serio *serio)struct serio_driver *drv = serio->drv;if (!drv || !serio_raw) { -printk (KERN_DEBUG "serio_raw: reconnect request, but serio is disconnected, ignoring...\n" ); + printk(KERN_DEBUG pr_fmt("reconnect request, but serio is disconnected, ignoring...\n"));return -1 ; }
drivers/input/serio/serport.c +4 -2
@@ -13,6 +13,8 @@* the Free Software Foundation. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <asm/uaccess.h> #include <linux/kernel.h> #include <linux/sched.h>
@@ -167,7 +169,7 @@ static ssize_t serport_ldisc_read(struct tty_struct * tty, struct file * file, u serio->port_data = serport;serio_register_port (serport->serio); -printk (KERN_INFO "serio: Serial port %s\n" ,tty_name (tty, name)); +pr_info ("Serial port %s\n" ,tty_name (tty, name));wait_event_interruptible (serport->wait,test_bit (SERPORT_DEAD , &serport->flags));serio_unregister_port (serport->serio);
@@ -237,7 +239,7 @@ static int __init serport_init(void)int retval; retval =tty_register_ldisc (N_MOUSE , &serport_ldisc);if (retval) -printk (KERN_ERR "serport.c: Error registering line discipline.\n" ); +pr_err ("Error registering line discipline\n" );return retval; }
Signature · 1 line
1.7.2.19.g9a302
cover drivers/input: Use pr_<level>
In reply to Dmitry TorokhovRemove prefixes from printks and convert to pr_fmt/pr_<level>.
Always make output prefix match module name. There are some existing uses that do not. For instance:
spaceorb used "input: " once, probably a copy/paste error, newtonkbd as well. Synaptics used "serio: ", etc.
A few miscellaneous typos corrected.
Converted a few uses of usb macros err to pr_err.
Compiled x86 only, some files not compile tested
Joe Perches (9):
drivers/input/gameport: Use pr_fmt and pr_<level> drivers/input/joystick: Use pr_fmt and pr_<level> drivers/input/keyboard: Use pr_fmt and pr_<level> drivers/input/misc: Use pr_fmt and pr_<level> drivers/input/mouse: Use pr_fmt and pr_<level> drivers/input/serio: Use pr_fmt and pr_<level> drivers/input/tablet: Use pr_fmt and pr_<level> drivers/input/touchscreen: Use pr_fmt and pr_<level> drivers/input: Use pr_fmt and pr_<level>
drivers/input/apm-power.c | 14 ++--- drivers/input/evbug.c | 18 ++++--- drivers/input/evdev.c | 15 +++--- drivers/input/ff-core.c | 6 +- drivers/input/ff-memless.c | 8 ++-- drivers/input/gameport/emu10k1-gp.c | 4 +- drivers/input/gameport/fm801-gp.c | 8 ++- drivers/input/gameport/lightning.c | 6 ++- drivers/input/gameport/ns558.c | 8 ++- drivers/input/input-polldev.c | 5 +- drivers/input/input.c | 22 ++++---- drivers/input/joydev.c | 4 +- drivers/input/joystick/a3d.c | 9 ++- drivers/input/joystick/adi.c | 12 +++-- drivers/input/joystick/amijoy.c | 4 +- drivers/input/joystick/analog.c | 15 +++-- drivers/input/joystick/cobra.c | 7 ++- drivers/input/joystick/db9.c | 16 +++--- drivers/input/joystick/gf2k.c | 7 ++- drivers/input/joystick/grip_mp.c | 15 +++-- drivers/input/joystick/guillemot.c | 11 +++- drivers/input/joystick/iforce/iforce-packets.c | 8 ++- drivers/input/joystick/interact.c | 7 ++- drivers/input/joystick/joydump.c | 40 ++++++++------- drivers/input/joystick/sidewinder.c | 58 ++++++++++++---------- drivers/input/joystick/spaceball.c | 6 ++- drivers/input/joystick/spaceorb.c | 15 ++++-- drivers/input/joystick/turbografx.c | 16 +++--- drivers/input/joystick/walkera0701.c | 6 ++- drivers/input/joystick/xpad.c | 4 +- drivers/input/keyboard/amikbd.c | 42 +++++++++++----- drivers/input/keyboard/atakbd.c | 4 +- drivers/input/keyboard/hil_kbd.c | 21 +++----- drivers/input/keyboard/hilkbd.c | 26 +++++----- drivers/input/keyboard/jornada680_kbd.c | 5 +- drivers/input/keyboard/jornada720_kbd.c | 10 ++-- drivers/input/keyboard/lkkbd.c | 54 ++++++++++---------- drivers/input/keyboard/locomokbd.c | 6 ++- drivers/input/keyboard/newtonkbd.c | 4 +- drivers/input/keyboard/omap-keypad.c | 25 +++++----- drivers/input/keyboard/sunkbd.c | 9 ++-- drivers/input/keyboard/xtkbd.c | 7 ++- drivers/input/misc/ati_remote.c | 22 +++++---- drivers/input/misc/ati_remote2.c | 6 ++- drivers/input/misc/cm109.c | 23 +++----- drivers/input/misc/hp_sdc_rtc.c | 10 ++-- drivers/input/misc/m68kspkr.c | 4 +- drivers/input/misc/powermate.c | 19 ++++--- drivers/input/misc/uinput.c | 25 +++++---- drivers/input/misc/winbond-cir.c | 6 ++- drivers/input/misc/wistron_btns.c | 29 ++++++----- drivers/input/misc/yealink.c | 5 +- drivers/input/mouse/alps.c | 12 +++-- drivers/input/mouse/appletouch.c | 64 +++++++++++------------ drivers/input/mouse/bcm5974.c | 48 +++++++++--------- drivers/input/mouse/elantech.c | 4 +- drivers/input/mouse/inport.c | 8 ++- drivers/input/mouse/lifebook.c | 5 +- drivers/input/mouse/logibm.c | 10 ++-- drivers/input/mouse/logips2pp.c | 13 +++-- drivers/input/mouse/pc110pad.c | 10 ++-- drivers/input/mouse/psmouse-base.c | 52 ++++++++++--------- drivers/input/mouse/rpcmouse.c | 4 +- drivers/input/mouse/sentelic.c | 13 +++-- drivers/input/mouse/sermouse.c | 6 ++- drivers/input/mouse/synaptics.c | 30 ++++++----- drivers/input/mouse/trackpoint.c | 10 ++-- drivers/input/mouse/vsxxxaa.c | 44 ++++++++--------- drivers/input/mousedev.c | 10 ++-- drivers/input/serio/ambakmi.c | 5 ++- drivers/input/serio/ct82c710.c | 10 ++-- drivers/input/serio/gscps2.c | 15 +++--- drivers/input/serio/hil_mlc.c | 17 +++--- drivers/input/serio/hp_sdc.c | 53 ++++++++++---------- drivers/input/serio/hp_sdc_mlc.c | 45 +++++++++-------- drivers/input/serio/i8042-x86ia64io.h | 43 +++++++--------- drivers/input/serio/i8042.c | 62 ++++++++++------------- drivers/input/serio/i8042.h | 21 +++++--- drivers/input/serio/maceps2.c | 5 ++- drivers/input/serio/parkbd.c | 8 ++- drivers/input/serio/q40kbd.c | 6 ++- drivers/input/serio/rpckbd.c | 6 ++- drivers/input/serio/sa1111ps2.c | 17 ++++--- drivers/input/serio/serio_raw.c | 10 ++-- drivers/input/serio/serport.c | 6 ++- drivers/input/tablet/acecad.c | 5 +- drivers/input/tablet/aiptek.c | 7 ++- drivers/input/tablet/gtco.c | 2 +- drivers/input/tablet/kbtab.c | 5 +- drivers/input/tablet/wacom_sys.c | 7 ++- drivers/input/tablet/wacom_wac.c | 8 ++- drivers/input/touchscreen/gunze.c | 5 ++- drivers/input/touchscreen/h3600_ts_input.c | 8 ++- drivers/input/touchscreen/hp680_ts_input.c | 3 +- drivers/input/touchscreen/htcpen.c | 15 +++--- drivers/input/touchscreen/inexio.c | 5 ++- drivers/input/touchscreen/jornada720_ts.c | 4 +- drivers/input/touchscreen/mk712.c | 10 ++-- drivers/input/touchscreen/mtouch.c | 7 ++- drivers/input/touchscreen/ucb1400_ts.c | 12 +++-- drivers/input/touchscreen/usbtouchscreen.c | 6 ++- drivers/input/xen-kbdfront.c | 10 ++-- 102 files changed, 848 insertions(+), 679 deletions(-)
Signature · 1 line
1.7.2.19.g9a302
PATCH 7/9 drivers/input/tablet: Use pr_fmt and pr_<level>
In reply to Dmitry Torokhov--- drivers/input/tablet/acecad.c | 5 +++-- drivers/input/tablet/aiptek.c | 7 ++++--- drivers/input/tablet/gtco.c | 2 +- drivers/input/tablet/kbtab.c | 5 +++-- drivers/input/tablet/wacom_sys.c | 7 ++++--- drivers/input/tablet/wacom_wac.c | 8 ++++++-- 6 files changed, 21 insertions(+), 13 deletions(-)
drivers/input/tablet/acecad.c +3 -2
@@ -25,6 +25,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/slab.h> #include <linux/module.h>
@@ -272,8 +274,7 @@ static int __init usb_acecad_init(void) {int result =usb_register (&usb_acecad_driver);if (result ==0 ) - printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" -DRIVER_DESC "\n" ); +pr_info (DRIVER_VERSION ":" DRIVER_DESC "\n" );return result; }
drivers/input/tablet/aiptek.c +4 -3
@@ -70,6 +70,8 @@* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/jiffies.h> #include <linux/kernel.h> #include <linux/slab.h>
@@ -1924,9 +1926,8 @@ static int __init aiptek_init(void) {int result =usb_register (&aiptek_driver);if (result ==0 ) { - printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" - DRIVER_DESC "\n"); - printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_AUTHOR "\n"); +pr_info (DRIVER_VERSION ":" DRIVER_DESC "\n" ); +pr_info (DRIVER_AUTHOR "\n" ); }return result; }
drivers/input/tablet/gtco.c +1 -1
@@ -1035,7 +1035,7 @@ static int __init gtco_init(void)return error; } -printk ("GTCO usb driver version: %s" ,GTCO_VERSION ); +pr_info ("GTCO usb driver version: %s\n" ,GTCO_VERSION );return 0 ; }
drivers/input/tablet/kbtab.c +3 -2
@@ -1,3 +1,5 @@ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/slab.h> #include <linux/module.h>
@@ -204,8 +206,7 @@ static int __init kbtab_init(void) retval =usb_register (&kbtab_driver);if (retval) goto out; - printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" - DRIVER_DESC "\n"); +pr_info (DRIVER_VERSION ":" DRIVER_DESC "\n" ); out:return retval; }
drivers/input/tablet/wacom_sys.c +4 -3
@@ -11,6 +11,8 @@* (at your option) any later version. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include "wacom_wac.h" #include "wacom.h"
@@ -343,7 +345,7 @@ static int wacom_retrieve_hid_descriptor(struct usb_interface *intf,if (usb_get_extra_descriptor (interface,HID_DEVICET_HID , &hid_desc)) {if (usb_get_extra_descriptor (&interface->endpoint[0 ],HID_DEVICET_REPORT , &hid_desc)) { -printk ("wacom: can not retrieve extra class descriptor\n" ); +pr_info ("can not retrieve extra class descriptor\n" ); error =1 ; goto out; }
@@ -610,8 +612,7 @@ static int __init wacom_init(void) result =usb_register (&wacom_driver);if (result ==0 ) - printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" -DRIVER_DESC "\n" ); +pr_info (DRIVER_VERSION ":" DRIVER_DESC "\n" );return result; }
drivers/input/tablet/wacom_wac.c +6 -2
@@ -12,6 +12,8 @@* (at your option) any later version. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include "wacom_wac.h" #include "wacom.h"
@@ -51,7 +53,8 @@ static int wacom_penpartner_irq(struct wacom_wac *wacom)break ;default : -printk (KERN_INFO "wacom_penpartner_irq: received unknown report #%d\n" , data[0 ]); +pr_info ("%s(): received unknown report #%d\n" , + __func__, data[0 ]);return 0 ; }
@@ -136,7 +139,8 @@ static int wacom_ptu_irq(struct wacom_wac *wacom)struct input_dev *input = wacom->input;if (data[0 ] !=WACOM_REPORT_PENABLED ) { -printk (KERN_INFO "wacom_ptu_irq: received unknown report #%d\n" , data[0 ]); +pr_info ("%s(): received unknown report #%d\n" , + __func__, data[0 ]);return 0 ; }
Signature · 1 line
1.7.2.19.g9a302
PATCH 8/9 drivers/input/touchscreen: Use pr_fmt and pr_<level>
In reply to Dmitry Torokhov--- drivers/input/touchscreen/gunze.c | 5 ++++- drivers/input/touchscreen/h3600_ts_input.c | 8 +++++--- drivers/input/touchscreen/hp680_ts_input.c | 3 +-- drivers/input/touchscreen/htcpen.c | 15 +++++++-------- drivers/input/touchscreen/inexio.c | 5 ++++- drivers/input/touchscreen/jornada720_ts.c | 4 +++- drivers/input/touchscreen/mk712.c | 10 ++++++---- drivers/input/touchscreen/mtouch.c | 7 +++++-- drivers/input/touchscreen/ucb1400_ts.c | 12 +++++++----- drivers/input/touchscreen/usbtouchscreen.c | 6 ++++-- 10 files changed, 46 insertions(+), 29 deletions(-)
drivers/input/touchscreen/gunze.c +4 -1
@@ -26,6 +26,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/errno.h> #include <linux/kernel.h> #include <linux/module.h>
@@ -64,7 +66,8 @@ static void gunze_process_packet(struct gunze* gunze)if (gunze->idx !=GUNZE_MAX_LENGTH || gunze->data[5 ] !=',' || (gunze->data[0 ] !='T' && gunze->data[0 ] !='R' )) { -printk (KERN_WARNING "gunze.c: bad packet: >%.*s<\n" ,GUNZE_MAX_LENGTH , gunze->data); +pr_warning ("bad packet: >%.*s<\n" , +GUNZE_MAX_LENGTH , gunze->data);return ; }
drivers/input/touchscreen/h3600_ts_input.c +5 -3
@@ -29,6 +29,8 @@* e-mail - mail your message to <[email protected]>. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/errno.h> #include <linux/kernel.h> #include <linux/module.h>
@@ -331,7 +333,7 @@ static irqreturn_t h3600ts_interrupt(struct serio *serio, unsigned char data,h3600ts_process_packet (ts);break ;default : -printk ("Error3\n" ); +pr_info ("Error3\n" );break ; }
@@ -397,14 +399,14 @@ static int h3600ts_connect(struct serio *serio, struct serio_driver *drv)if (request_irq (IRQ_GPIO_BITSY_ACTION_BUTTON , action_button_handler,IRQF_SHARED |IRQF_DISABLED ,"h3600_action" , &ts->dev)) { -printk (KERN_ERR "h3600ts.c: Could not allocate Action Button IRQ!\n" ); +pr_err ("Could not allocate Action Button IRQ!\n" ); err = -EBUSY ; goto fail2; }if (request_irq (IRQ_GPIO_BITSY_NPOWER_BUTTON , npower_button_handler,IRQF_SHARED |IRQF_DISABLED ,"h3600_suspend" , &ts->dev)) { -printk (KERN_ERR "h3600ts.c: Could not allocate Power Button IRQ!\n" ); +pr_err ("Could not allocate Power Button IRQ!\n" ); err = -EBUSY ; goto fail3; }
drivers/input/touchscreen/hp680_ts_input.c +1 -2
@@ -94,8 +94,7 @@ static int __init hp680_ts_init(void)if (request_irq (HP680_TS_IRQ , hp680_ts_interrupt,IRQF_DISABLED ,MODNAME ,0 ) <0 ) { -printk (KERN_ERR "hp680_touchscreen.c: Can't allocate irq %d\n" , -HP680_TS_IRQ ); +pr_err ("Can't allocate irq %d\n" ,HP680_TS_IRQ ); err = -EBUSY ; goto fail1; }
drivers/input/touchscreen/htcpen.c +7 -8
@@ -8,6 +8,8 @@* by the Free Software Foundation. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/errno.h> #include <linux/kernel.h> #include <linux/module.h>
@@ -114,26 +116,23 @@ static int __devinit htcpen_isa_probe(struct device *dev, unsigned int id)int err = -EBUSY ;if (!request_region (HTCPEN_PORT_IRQ_CLEAR ,1 ,"htcpen" )) { -printk (KERN_ERR "htcpen: unable to get IO region 0x%x\n" , -HTCPEN_PORT_IRQ_CLEAR ); +pr_err ("unable to get IO region 0x%x\n" ,HTCPEN_PORT_IRQ_CLEAR ); goto request_region1_failed; }if (!request_region (HTCPEN_PORT_INIT ,1 ,"htcpen" )) { -printk (KERN_ERR "htcpen: unable to get IO region 0x%x\n" , -HTCPEN_PORT_INIT ); +pr_err ("unable to get IO region 0x%x\n" ,HTCPEN_PORT_INIT ); goto request_region2_failed; }if (!request_region (HTCPEN_PORT_INDEX ,2 ,"htcpen" )) { -printk (KERN_ERR "htcpen: unable to get IO region 0x%x\n" , -HTCPEN_PORT_INDEX ); +pr_err ("unable to get IO region 0x%x\n" ,HTCPEN_PORT_INDEX ); goto request_region3_failed; } htcpen_dev =input_allocate_device ();if (!htcpen_dev) { -printk (KERN_ERR "htcpen: can't allocate device\n" ); +pr_err ("can't allocate device\n" ); err = -ENOMEM ; goto input_alloc_failed; }
@@ -152,7 +151,7 @@ static int __devinit htcpen_isa_probe(struct device *dev, unsigned int id) err =request_irq (HTCPEN_IRQ , htcpen_interrupt,0 ,"htcpen" , htcpen_dev);if (err) { -printk (KERN_ERR "htcpen: irq busy\n" ); +pr_err ("irq busy\n" ); goto request_irq_failed; }
drivers/input/touchscreen/inexio.c +4 -1
@@ -17,6 +17,8 @@* Copied mtouch.c and edited for iNexio protocol */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/errno.h> #include <linux/kernel.h> #include <linux/module.h>
@@ -87,7 +89,8 @@ static irqreturn_t inexio_interrupt(struct serio *serio,if (INEXIO_RESPONSE_BEGIN_BYTE &pinexio->data[0 ])inexio_process_data (pinexio);else -printk (KERN_DEBUG "inexio.c: unknown/unsynchronized data from device, byte %x\n" ,pinexio->data[0 ]); + printk(KERN_DEBUG pr_fmt("unknown/unsynchronized data from device, byte %x\n"), + pinexio->data[0 ]);return IRQ_HANDLED ; }
drivers/input/touchscreen/jornada720_ts.c +3 -1
@@ -13,6 +13,8 @@* HP Jornada 710/720/729 Touchscreen Driver */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/platform_device.h> #include <linux/init.h> #include <linux/input.h>
@@ -130,7 +132,7 @@ static int __devinit jornada720_ts_probe(struct platform_device *pdev)IRQF_DISABLED |IRQF_TRIGGER_RISING , "HP7XX Touchscreen driver", pdev);if (error) { -printk (KERN_INFO "HP7XX TS : Unable to acquire irq!\n" ); +pr_info ("Unable to acquire irq!\n" ); goto fail1; }
drivers/input/touchscreen/mk712.c +6 -4
@@ -35,6 +35,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h>
@@ -154,7 +156,7 @@ static int __init mk712_init(void)int err;if (!request_region (mk712_io,8 ,"mk712" )) { -printk (KERN_WARNING "mk712: unable to get IO region\n" ); +pr_warning ("unable to get IO region\n" );return -ENODEV ; }
@@ -163,14 +165,14 @@ static int __init mk712_init(void)if ((inw (mk712_io +MK712_X ) &0xf000 ) ||/* Sanity check */ (inw (mk712_io +MK712_Y ) &0xf000 ) || (inw (mk712_io +MK712_STATUS ) &0xf333 )) { -printk (KERN_WARNING "mk712: device not present\n" ); +pr_warning ("device not present\n" ); err = -ENODEV ; goto fail1; } mk712_dev =input_allocate_device ();if (!mk712_dev) { -printk (KERN_ERR "mk712: not enough memory\n" ); +pr_err ("not enough memory\n" ); err = -ENOMEM ; goto fail1; }
@@ -191,7 +193,7 @@ static int __init mk712_init(void)input_set_abs_params (mk712_dev,ABS_Y ,0 ,0xfff ,88 ,0 );if (request_irq (mk712_irq, mk712_interrupt,0 ,"mk712" , mk712_dev)) { -printk (KERN_WARNING "mk712: unable to get IRQ\n" ); +pr_warning ("unable to get IRQ\n" ); err = -EBUSY ; goto fail1; }
drivers/input/touchscreen/mtouch.c +5 -2
@@ -15,6 +15,8 @@* Copied elo.c and edited for MicroTouch protocol */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/errno.h> #include <linux/kernel.h> #include <linux/module.h>
@@ -83,7 +85,7 @@ static void mtouch_process_response(struct mtouch *mtouch)/* FIXME - process response */ mtouch->idx =0 ; }else if (MTOUCH_MAX_LENGTH == mtouch->idx) { -printk (KERN_ERR "mtouch.c: too many response bytes\n" ); +pr_err ("too many response bytes\n" ); mtouch->idx =0 ; } }
@@ -100,7 +102,8 @@ static irqreturn_t mtouch_interrupt(struct serio *serio,else if (MTOUCH_RESPONSE_BEGIN_BYTE == mtouch->data[0 ])mtouch_process_response (mtouch);else -printk (KERN_DEBUG "mtouch.c: unknown/unsynchronized data from device, byte %x\n" ,mtouch->data[0 ]); + printk(KERN_DEBUG pr_fmt("unknown/unsynchronized data from device, byte %x\n"), + mtouch->data[0 ]);return IRQ_HANDLED ; }
drivers/input/touchscreen/ucb1400_ts.c +7 -5
@@ -18,6 +18,8 @@* been made separate from ucb1x00-core/ucb1x00-ts on Russell's request. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/init.h> #include <linux/completion.h>
@@ -321,7 +323,7 @@ static int ucb1400_ts_detect_irq(struct ucb1400_ts *ucb) UCB_ADC_DAT_VALID)) {cpu_relax ();if (time_after (jiffies, timeout)) { -printk (KERN_ERR "ucb1400: timed out in IRQ probe\n" ); +pr_err ("timed out in IRQ probe\n" );probe_irq_off (mask);return -ENODEV ; }
@@ -358,7 +360,7 @@ static int ucb1400_ts_probe(struct platform_device *dev)if (ucb->irq <0 ) { error =ucb1400_ts_detect_irq (ucb);if (error) { -printk (KERN_ERR "UCB1400: IRQ probe failed\n" ); +pr_err ("IRQ probe failed\n" ); goto err_free_devs; } }
@@ -368,11 +370,11 @@ static int ucb1400_ts_probe(struct platform_device *dev) error =request_irq (ucb->irq, ucb1400_hard_irq,IRQF_TRIGGER_RISING ,"UCB1400" , ucb);if (error) { -printk (KERN_ERR "ucb1400: unable to grab irq%d: %d\n" , +pr_err ("unable to grab irq%d: %d\n" , ucb->irq, error); goto err_free_devs; } -printk (KERN_DEBUG "UCB1400: found IRQ %d\n" , ucb->irq); + printk(KERN_DEBUG pr_fmt("found IRQ %d\n"), ucb->irq);input_set_drvdata (ucb->ts_idev, ucb);
@@ -398,7 +400,7 @@ static int ucb1400_ts_probe(struct platform_device *dev) x_res =ucb1400_ts_read_xres (ucb); y_res =ucb1400_ts_read_yres (ucb);ucb1400_adc_disable (ucb->ac97); -printk (KERN_DEBUG "UCB1400: x/y = %d/%d\n" , x_res, y_res); + printk(KERN_DEBUG pr_fmt("x/y = %d/%d\n"), x_res, y_res);input_set_abs_params (ucb->ts_idev,ABS_X ,0 , x_res,0 ,0 );input_set_abs_params (ucb->ts_idev,ABS_Y ,0 , y_res,0 ,0 );
drivers/input/touchscreen/usbtouchscreen.c +4 -2
@@ -43,6 +43,8 @@* *****************************************************************************/ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +//#define DEBUG #include <linux/kernel.h>
@@ -832,8 +834,8 @@ static int nexio_init(struct usbtouch_usb *usbtouch) } } -printk (KERN_INFO "Nexio device: %s, firmware version: %s\n" , - device_name, firmware_ver); +pr_info ("Nexio device: %s, firmware version: %s\n" , + device_name, firmware_ver);kfree (firmware_ver);kfree (device_name);
Signature · 1 line
1.7.2.19.g9a302
PATCH 9/9 drivers/input: Use pr_fmt and pr_<level>
In reply to Dmitry Torokhov--- drivers/input/apm-power.c | 14 ++++++-------- drivers/input/evbug.c | 18 ++++++++++-------- drivers/input/evdev.c | 15 ++++++++------- drivers/input/ff-core.c | 6 +++--- drivers/input/ff-memless.c | 8 ++++---- drivers/input/input-polldev.c | 5 +++-- drivers/input/input.c | 22 +++++++++++----------- drivers/input/joydev.c | 4 +++- drivers/input/mousedev.c | 10 ++++++---- drivers/input/xen-kbdfront.c | 10 +++++----- 10 files changed, 59 insertions(+), 53 deletions(-)
drivers/input/apm-power.c +6 -8
@@ -9,6 +9,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/module.h> #include <linux/input.h> #include <linux/slab.h>
@@ -23,8 +25,7 @@ static void system_power_event(unsigned int keycode)switch (keycode) {case KEY_SUSPEND :apm_queue_event (APM_USER_SUSPEND ); - -printk (KERN_INFO "apm-power: Requesting system suspend...\n" ); +pr_info ("Requesting system suspend...\n" );break ;default :break ;
@@ -65,18 +66,15 @@ static int apmpower_connect(struct input_handler *handler, error =input_register_handle (handle);if (error) { -printk (KERN_ERR -"apm-power: Failed to register input power handler, " -"error %d\n" , error); +pr_err ("Failed to register input power handler, error %d\n" , + error);kfree (handle);return error; } error =input_open_device (handle);if (error) { -printk (KERN_ERR -"apm-power: Failed to open input power device, " -"error %d\n" , error); +pr_err ("Failed to open input power device, error %d\n" , error);input_unregister_handle (handle);kfree (handle);return error;
drivers/input/evbug.c +10 -8
@@ -26,6 +26,8 @@* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/slab.h> #include <linux/module.h> #include <linux/input.h>
@@ -38,8 +40,8 @@ MODULE_LICENSE("GPL");static void evbug_event (struct input_handle *handle,unsigned int type,unsigned int code,int value) { -printk (KERN_DEBUG "evbug.c: Event. Dev: %s, Type: %d, Code: %d, Value: %d\n" , -dev_name (&handle->dev->dev), type, code, value); + printk(KERN_DEBUG pr_fmt("Event. Dev: %s, Type: %d, Code: %d, Value: %d\n"), + dev_name(&handle->dev->dev), type, code, value); } static int evbug_connect(struct input_handler *handler, struct input_dev *dev,
@@ -64,10 +66,10 @@ static int evbug_connect(struct input_handler *handler, struct input_dev *dev,if (error) goto err_unregister_handle; -printk (KERN_DEBUG "evbug.c: Connected device: %s (%s at %s)\n" , -dev_name (&dev->dev), - dev->name ?:"unknown" , - dev->phys ?:"unknown" ); + printk(KERN_DEBUG pr_fmt("Connected device: %s (%s at %s)\n"), +dev_name (&dev->dev), + dev->name ?:"unknown" , + dev->phys ?: "unknown");return 0 ;
@@ -80,8 +82,8 @@ static int evbug_connect(struct input_handler *handler, struct input_dev *dev,static void evbug_disconnect (struct input_handle *handle) { -printk (KERN_DEBUG "evbug.c: Disconnected device: %s\n" , -dev_name (&handle->dev->dev)); + printk(KERN_DEBUG pr_fmt("Disconnected device: %s\n"), + dev_name(&handle->dev->dev));input_close_device (handle);input_unregister_handle (handle);
drivers/input/evdev.c +8 -7
@@ -8,6 +8,8 @@* the Free Software Foundation. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#define EVDEV_MINOR_BASE 64#define EVDEV_MINORS 32#define EVDEV_MIN_BUFFER_SIZE 64U
@@ -522,12 +524,11 @@ static int handle_eviocgbit(struct input_dev *dev,if (type ==EV_KEY && size ==OLD_KEY_MAX ) { len =OLD_KEY_MAX ;if (printk_timed_ratelimit (&keymax_warn_time,10 *1000 )) -printk (KERN_WARNING -"evdev.c(EVIOCGBIT): Suspicious buffer size %u, " -"limiting output to %zu bytes. See " -"http://userweb.kernel.org/~dtor/eviocgbit-bug.html\n" , -OLD_KEY_MAX , -BITS_TO_LONGS (OLD_KEY_MAX ) *sizeof (long )); +pr_warning ("(EVIOCGBIT): Suspicious buffer size %u, " +"limiting output to %zu bytes. See " +"http://userweb.kernel.org/~dtor/eviocgbit-bug.html\n" , +OLD_KEY_MAX , +BITS_TO_LONGS (OLD_KEY_MAX ) *sizeof (long )); }return bits_to_user (bits, len, size, p, compat_mode);
@@ -866,7 +867,7 @@ static int evdev_connect(struct input_handler *handler, struct input_dev *dev,break ;if (minor ==EVDEV_MINORS ) { -printk (KERN_ERR "evdev: no more free evdev devices\n" ); +pr_err ("no more free evdev devices\n" );return -ENFILE ; }
drivers/input/ff-core.c +3 -3
@@ -23,7 +23,8 @@/* #define DEBUG */ -#define debug(format, arg...) pr_debug("ff-core: " format "\n", ## arg) +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#define debug(format, arg...) pr_debug(format "\n", ## arg)#include <linux/input.h> #include <linux/module.h>
@@ -315,8 +316,7 @@ int input_ff_create(struct input_dev *dev, int max_effects)int i;if (!max_effects) { -printk (KERN_ERR -"ff-core: cannot allocate device without any effects\n" ); +pr_err ("cannot allocate device without any effects\n" );return -EINVAL ; }
drivers/input/ff-memless.c +4 -4
@@ -23,7 +23,8 @@/* #define DEBUG */ -#define debug(format, arg...) pr_debug("ff-memless: " format "\n", ## arg) +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#define debug(format, arg...) pr_debug(format "\n", ##arg)#include <linux/slab.h> #include <linux/input.h>
@@ -215,8 +216,7 @@ static int get_compatible_type(struct ff_device *ff, int effect_type)if (effect_type ==FF_PERIODIC &&test_bit (FF_RUMBLE , ff->ffbit))return FF_RUMBLE ; -printk (KERN_ERR -"ff-memless: invalid type in get_compatible_type()\n" ); +pr_err ("invalid type in get_compatible_type()\n" );return 0 ; }
@@ -312,7 +312,7 @@ static void ml_combine_effects(struct ff_effect *effect,break ;default : -printk (KERN_ERR "ff-memless: invalid type in ml_combine_effects()\n" ); +pr_err ("invalid type in ml_combine_effects()\n" );break ; }
drivers/input/input-polldev.c +3 -2
@@ -8,6 +8,8 @@* the Free Software Foundation. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/jiffies.h> #include <linux/slab.h> #include <linux/mutex.h>
@@ -33,8 +35,7 @@ static int input_polldev_start_workqueue(void)if (!polldev_users) { polldev_wq =create_singlethread_workqueue ("ipolldevd" );if (!polldev_wq) { -printk (KERN_ERR "input-polldev: failed to create " -"ipolldevd workqueue\n" ); +pr_err ("failed to create ipolldevd workqueue\n" ); retval = -ENOMEM ; goto out; }
drivers/input/input.c +11 -11
@@ -10,6 +10,8 @@* the Free Software Foundation. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/init.h> #include <linux/types.h> #include <linux/input.h>
@@ -1056,10 +1058,8 @@ static int input_attach_handler(struct input_dev *dev, struct input_handler *han error = handler->connect (handler, dev, id);if (error && error != -ENODEV ) -printk (KERN_ERR -"input: failed to attach handler %s to device %s, " -"error: %d\n" , - handler->name,kobject_name (&dev->dev.kobj), error); +pr_err ("failed to attach handler %s to device %s, error: %d\n" , + handler->name,kobject_name (&dev->dev.kobj), error);return error; }
@@ -1890,9 +1890,8 @@ void input_set_capability(struct input_dev *dev, unsigned int type, unsigned intbreak ;default : -printk (KERN_ERR -"input_set_capability: unknown type %u (code %u)\n" , - type, code); +pr_err ("input_set_capability: unknown type %u (code %u)\n" , + type, code);dump_stack ();return ; }
@@ -1980,8 +1979,9 @@ int input_register_device(struct input_dev *dev)return error; path =kobject_get_path (&dev->dev.kobj,GFP_KERNEL ); -printk (KERN_INFO "input: %s as %s\n" , - dev->name ? dev->name :"Unspecified device" , path ? path :"N/A" ); +pr_info ("%s as %s\n" , + dev->name ? dev->name :"Unspecified device" , + path ? path :"N/A" );kfree (path); error =mutex_lock_interruptible (&input_mutex);
@@ -2262,7 +2262,7 @@ static int __init input_init(void) err =class_register (&input_class);if (err) { -printk (KERN_ERR "input: unable to register input_dev class\n" ); +pr_err ("unable to register input_dev class\n" );return err; }
@@ -2272,7 +2272,7 @@ static int __init input_init(void) err =register_chrdev (INPUT_MAJOR ,"input" , &input_fops);if (err) { -printk (KERN_ERR "input: unable to register char major %d" ,INPUT_MAJOR ); +pr_err ("unable to register char major %d" ,INPUT_MAJOR ); goto fail2; }
drivers/input/joydev.c +3 -1
@@ -10,6 +10,8 @@* (at your option) any later version. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <asm/io.h> #include <asm/system.h> #include <linux/delay.h>
@@ -802,7 +804,7 @@ static int joydev_connect(struct input_handler *handler, struct input_dev *dev,break ;if (minor ==JOYDEV_MINORS ) { -printk (KERN_ERR "joydev: no more free joydev devices\n" ); +pr_err ("no more free joydev devices\n" );return -ENFILE ; }
drivers/input/mousedev.c +6 -4
@@ -9,6 +9,8 @@* the Free Software Foundation. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#define MOUSEDEV_MINOR_BASE 32#define MOUSEDEV_MINORS 32#define MOUSEDEV_MIX 31
@@ -976,7 +978,7 @@ static int mousedev_connect(struct input_handler *handler,break ;if (minor ==MOUSEDEV_MINORS ) { -printk (KERN_ERR "mousedev: no more free mousedev devices\n" ); +pr_err ("no more free mousedev devices\n" );return -ENFILE ; }
@@ -1086,13 +1088,13 @@ static int __init mousedev_init(void)#ifdef CONFIG_INPUT_MOUSEDEV_PSAUX error =misc_register (&psaux_mouse);if (error) -printk (KERN_WARNING "mice: could not register psaux device, " -"error: %d\n" , error); +pr_warning ("could not register psaux device, error: %d\n" , + error);else psaux_registered =1 ;#endif -printk (KERN_INFO "mice: PS/2 mouse device common for all mice\n" ); +pr_info ("PS/2 mouse device common for all mice\n" );return 0 ; }
drivers/input/xen-kbdfront.c +5 -5
@@ -17,6 +17,8 @@* Switch to grant tables together with xen-fbfront.c. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/errno.h> #include <linux/module.h>
@@ -84,9 +86,8 @@ static irqreturn_t input_handler(int rq, void *dev_id)input_report_key (dev, event->key.keycode, event->key.pressed); else - printk(KERN_WARNING -"xenkbd: unhandled keycode 0x%x\n" , - event->key.keycode); + pr_warning("unhandled keycode 0x%x\n", + event->key.keycode);break ;case XENKBD_TYPE_POS :input_report_abs (dev,ABS_X , event->pos.abs_x);
@@ -290,8 +291,7 @@ InitWait: ret =xenbus_printf (XBT_NIL , info->xbdev->nodename,"request-abs-pointer" ,"1" );if (ret) -printk (KERN_WARNING -"xenkbd: can't request abs-pointer" ); +pr_warning ("can't request abs-pointer\n" ); }xenbus_switch_state (dev, XenbusStateConnected);break ;
Signature · 1 line
1.7.2.19.g9a302