diff options
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r-- | drivers/input/mouse/appletouch.c | 59 | ||||
-rw-r--r-- | drivers/input/mouse/bcm5974.c | 24 |
2 files changed, 47 insertions, 36 deletions
diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c index 0acbc7d50d0..e42f1fa8cdc 100644 --- a/drivers/input/mouse/appletouch.c +++ b/drivers/input/mouse/appletouch.c @@ -195,6 +195,7 @@ enum atp_status_bits { struct atp { char phys[64]; struct usb_device *udev; /* usb device */ + struct usb_interface *intf; /* usb interface */ struct urb *urb; /* usb request block */ u8 *data; /* transferred data */ struct input_dev *input; /* input dev */ @@ -253,8 +254,9 @@ MODULE_PARM_DESC(debug, "Activate debugging output"); * packets (Report ID 2). This code changes device mode, so it * sends raw sensor reports (Report ID 5). */ -static int atp_geyser_init(struct usb_device *udev) +static int atp_geyser_init(struct atp *dev) { + struct usb_device *udev = dev->udev; char *data; int size; int i; @@ -262,7 +264,7 @@ static int atp_geyser_init(struct usb_device *udev) data = kmalloc(8, GFP_KERNEL); if (!data) { - err("Out of memory"); + dev_err(&dev->intf->dev, "Out of memory\n"); return -ENOMEM; } @@ -277,7 +279,7 @@ static int atp_geyser_init(struct usb_device *udev) for (i = 0; i < 8; i++) dprintk("appletouch[%d]: %d\n", i, data[i]); - err("Failed to read mode from device."); + dev_err(&dev->intf->dev, "Failed to read mode from device.\n"); ret = -EIO; goto out_free; } @@ -296,7 +298,7 @@ static int atp_geyser_init(struct usb_device *udev) for (i = 0; i < 8; i++) dprintk("appletouch[%d]: %d\n", i, data[i]); - err("Failed to request geyser raw mode"); + dev_err(&dev->intf->dev, "Failed to request geyser raw mode\n"); ret = -EIO; goto out_free; } @@ -313,16 +315,16 @@ out_free: static void atp_reinit(struct work_struct *work) { struct atp *dev = container_of(work, struct atp, work); - struct usb_device *udev = dev->udev; int retval; dprintk("appletouch: putting appletouch to sleep (reinit)\n"); - atp_geyser_init(udev); + atp_geyser_init(dev); retval = usb_submit_urb(dev->urb, GFP_ATOMIC); if (retval) - err("atp_reinit: usb_submit_urb failed with error %d", - retval); + dev_err(&dev->intf->dev, + "atp_reinit: usb_submit_urb failed with error %d\n", + retval); } static int atp_calculate_abs(int *xy_sensors, int nb_sensors, int fact, @@ -400,6 +402,7 @@ static inline void atp_report_fingers(struct input_dev *input, int fingers) static int atp_status_check(struct urb *urb) { struct atp *dev = urb->context; + struct usb_interface *intf = dev->intf; switch (urb->status) { case 0: @@ -407,8 +410,8 @@ static int atp_status_check(struct urb *urb) break; case -EOVERFLOW: if (!dev->overflow_warned) { - printk(KERN_WARNING "appletouch: OVERFLOW with data " - "length %d, actual length is %d\n", + dev_warn(&intf->dev, + "appletouch: OVERFLOW with data length %d, actual length is %d\n", dev->info->datalen, dev->urb->actual_length); dev->overflow_warned = true; } @@ -416,13 +419,15 @@ static int atp_status_check(struct urb *urb) case -ENOENT: case -ESHUTDOWN: /* This urb is terminated, clean up */ - dbg("atp_complete: urb shutting down with status: %d", - urb->status); + dev_dbg(&intf->dev, + "atp_complete: urb shutting down with status: %d\n", + urb->status); return ATP_URB_STATUS_ERROR_FATAL; default: - dbg("atp_complete: nonzero urb status received: %d", - urb->status); + dev_dbg(&intf->dev, + "atp_complete: nonzero urb status received: %d\n", + urb->status); return ATP_URB_STATUS_ERROR; } @@ -445,7 +450,8 @@ static void atp_detect_size(struct atp *dev) for (i = dev->info->xsensors; i < ATP_XSENSORS; i++) { if (dev->xy_cur[i]) { - printk(KERN_INFO "appletouch: 17\" model detected.\n"); + dev_info(&dev->intf->dev, + "appletouch: 17\" model detected.\n"); input_set_abs_params(dev->input, ABS_X, 0, (dev->info->xsensors_17 - 1) * @@ -588,8 +594,9 @@ static void atp_complete_geyser_1_2(struct urb *urb) exit: retval = usb_submit_urb(dev->urb, GFP_ATOMIC); if (retval) - err("atp_complete: usb_submit_urb failed with result %d", - retval); + dev_err(&dev->intf->dev, + "atp_complete: usb_submit_urb failed with result %d\n", + retval); } /* Interrupt function for older touchpads: GEYSER3/GEYSER4 */ @@ -722,8 +729,9 @@ static void atp_complete_geyser_3_4(struct urb *urb) exit: retval = usb_submit_urb(dev->urb, GFP_ATOMIC); if (retval) - err("atp_complete: usb_submit_urb failed with result %d", - retval); + dev_err(&dev->intf->dev, + "atp_complete: usb_submit_urb failed with result %d\n", + retval); } static int atp_open(struct input_dev *input) @@ -748,14 +756,12 @@ static void atp_close(struct input_dev *input) static int atp_handle_geyser(struct atp *dev) { - struct usb_device *udev = dev->udev; - if (dev->info != &fountain_info) { /* switch to raw sensor mode */ - if (atp_geyser_init(udev)) + if (atp_geyser_init(dev)) return -EIO; - printk(KERN_INFO "appletouch: Geyser mode initialized.\n"); + dev_info(&dev->intf->dev, "Geyser mode initialized.\n"); } return 0; @@ -785,7 +791,7 @@ static int atp_probe(struct usb_interface *iface, } } if (!int_in_endpointAddr) { - err("Could not find int-in endpoint"); + dev_err(&iface->dev, "Could not find int-in endpoint\n"); return -EIO; } @@ -793,11 +799,12 @@ static int atp_probe(struct usb_interface *iface, dev = kzalloc(sizeof(struct atp), GFP_KERNEL); input_dev = input_allocate_device(); if (!dev || !input_dev) { - err("Out of memory"); + dev_err(&iface->dev, "Out of memory\n"); goto err_free_devs; } dev->udev = udev; + dev->intf = iface; dev->input = input_dev; dev->info = info; dev->overflow_warned = false; @@ -886,7 +893,7 @@ static void atp_disconnect(struct usb_interface *iface) usb_free_urb(dev->urb); kfree(dev); } - printk(KERN_INFO "input: appletouch disconnected\n"); + dev_info(&iface->dev, "input: appletouch disconnected\n"); } static int atp_recover(struct atp *dev) diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c index f9e2758b9f4..2cf681d98c0 100644 --- a/drivers/input/mouse/bcm5974.c +++ b/drivers/input/mouse/bcm5974.c @@ -584,7 +584,7 @@ static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on) int retval = 0, size; if (!data) { - err("bcm5974: out of memory"); + dev_err(&dev->intf->dev, "out of memory\n"); retval = -ENOMEM; goto out; } @@ -597,7 +597,7 @@ static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on) BCM5974_WELLSPRING_MODE_REQUEST_INDEX, data, 8, 5000); if (size != 8) { - err("bcm5974: could not read from device"); + dev_err(&dev->intf->dev, "could not read from device\n"); retval = -EIO; goto out; } @@ -615,7 +615,7 @@ static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on) BCM5974_WELLSPRING_MODE_REQUEST_INDEX, data, 8, 5000); if (size != 8) { - err("bcm5974: could not write to device"); + dev_err(&dev->intf->dev, "could not write to device\n"); retval = -EIO; goto out; } @@ -631,6 +631,7 @@ static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on) static void bcm5974_irq_button(struct urb *urb) { struct bcm5974 *dev = urb->context; + struct usb_interface *intf = dev->intf; int error; switch (urb->status) { @@ -640,10 +641,11 @@ static void bcm5974_irq_button(struct urb *urb) case -ECONNRESET: case -ENOENT: case -ESHUTDOWN: - dbg("bcm5974: button urb shutting down: %d", urb->status); + dev_dbg(&intf->dev, "button urb shutting down: %d\n", + urb->status); return; default: - dbg("bcm5974: button urb status: %d", urb->status); + dev_dbg(&intf->dev, "button urb status: %d\n", urb->status); goto exit; } @@ -654,12 +656,13 @@ static void bcm5974_irq_button(struct urb *urb) exit: error = usb_submit_urb(dev->bt_urb, GFP_ATOMIC); if (error) - err("bcm5974: button urb failed: %d", error); + dev_err(&intf->dev, "button urb failed: %d\n", error); } static void bcm5974_irq_trackpad(struct urb *urb) { struct bcm5974 *dev = urb->context; + struct usb_interface *intf = dev->intf; int error; switch (urb->status) { @@ -669,10 +672,11 @@ static void bcm5974_irq_trackpad(struct urb *urb) case -ECONNRESET: case -ENOENT: case -ESHUTDOWN: - dbg("bcm5974: trackpad urb shutting down: %d", urb->status); + dev_dbg(&intf->dev, "trackpad urb shutting down: %d\n", + urb->status); return; default: - dbg("bcm5974: trackpad urb status: %d", urb->status); + dev_dbg(&intf->dev, "trackpad urb status: %d\n", urb->status); goto exit; } @@ -687,7 +691,7 @@ static void bcm5974_irq_trackpad(struct urb *urb) exit: error = usb_submit_urb(dev->tp_urb, GFP_ATOMIC); if (error) - err("bcm5974: trackpad urb failed: %d", error); + dev_err(&intf->dev, "trackpad urb failed: %d\n", error); } /* @@ -833,7 +837,7 @@ static int bcm5974_probe(struct usb_interface *iface, dev = kzalloc(sizeof(struct bcm5974), GFP_KERNEL); input_dev = input_allocate_device(); if (!dev || !input_dev) { - err("bcm5974: out of memory"); + dev_err(&iface->dev, "out of memory\n"); goto err_free_devs; } |