]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/storage/onetouch.c
USB: remove err() macro from more usb drivers
[linux-2.6-omap-h63xx.git] / drivers / usb / storage / onetouch.c
index 6d3dad3d1daeb2c84d5531a934e9dae7f5f1b9dc..c7bf8954b4e4de35af0be81e9d7244ed9881eb16 100644 (file)
@@ -38,7 +38,7 @@
 #include "onetouch.h"
 #include "debug.h"
 
-void onetouch_release_input(void *onetouch_);
+static void onetouch_release_input(void *onetouch_);
 
 struct usb_onetouch {
        char name[128];
@@ -57,9 +57,10 @@ static void usb_onetouch_irq(struct urb *urb)
        struct usb_onetouch *onetouch = urb->context;
        signed char *data = onetouch->data;
        struct input_dev *dev = onetouch->dev;
-       int status;
+       int status = urb->status;
+       int retval;
 
-       switch (urb->status) {
+       switch (status) {
        case 0:                 /* success */
                break;
        case -ECONNRESET:       /* unlink */
@@ -75,21 +76,21 @@ static void usb_onetouch_irq(struct urb *urb)
        input_sync(dev);
 
 resubmit:
-       status = usb_submit_urb (urb, GFP_ATOMIC);
-       if (status)
-               err ("can't resubmit intr, %s-%s/input0, status %d",
-                       onetouch->udev->bus->bus_name,
-                       onetouch->udev->devpath, status);
+       retval = usb_submit_urb (urb, GFP_ATOMIC);
+       if (retval)
+               dev_err(&dev->dev, "can't resubmit intr, %s-%s/input0, "
+                       "retval %d\n", onetouch->udev->bus->bus_name,
+                       onetouch->udev->devpath, retval);
 }
 
 static int usb_onetouch_open(struct input_dev *dev)
 {
-       struct usb_onetouch *onetouch = dev->private;
+       struct usb_onetouch *onetouch = input_get_drvdata(dev);
 
        onetouch->is_open = 1;
        onetouch->irq->dev = onetouch->udev;
        if (usb_submit_urb(onetouch->irq, GFP_KERNEL)) {
-               err("usb_submit_urb failed");
+               dev_err(&dev->dev, "usb_submit_urb failed\n");
                return -EIO;
        }
 
@@ -98,7 +99,7 @@ static int usb_onetouch_open(struct input_dev *dev)
 
 static void usb_onetouch_close(struct input_dev *dev)
 {
-       struct usb_onetouch *onetouch = dev->private;
+       struct usb_onetouch *onetouch = input_get_drvdata(dev);
 
        usb_kill_urb(onetouch->irq);
        onetouch->is_open = 0;
@@ -116,7 +117,8 @@ static void usb_onetouch_pm_hook(struct us_data *us, int action)
                        break;
                case US_RESUME:
                        if (usb_submit_urb(onetouch->irq, GFP_KERNEL) != 0)
-                               err("usb_submit_urb failed");
+                               dev_err(&onetouch->irq->dev->dev,
+                                       "usb_submit_urb failed\n");
                        break;
                default:
                        break;
@@ -185,13 +187,14 @@ int onetouch_connect_input(struct us_data *ss)
        input_dev->name = onetouch->name;
        input_dev->phys = onetouch->phys;
        usb_to_input_id(udev, &input_dev->id);
-       input_dev->cdev.dev = &udev->dev;
+       input_dev->dev.parent = &udev->dev;
 
        set_bit(EV_KEY, input_dev->evbit);
        set_bit(ONETOUCH_BUTTON, input_dev->keybit);
        clear_bit(0, input_dev->keybit);
 
-       input_dev->private = onetouch;
+       input_set_drvdata(input_dev, onetouch);
+
        input_dev->open = usb_onetouch_open;
        input_dev->close = usb_onetouch_close;
 
@@ -221,7 +224,7 @@ int onetouch_connect_input(struct us_data *ss)
        return error;
 }
 
-void onetouch_release_input(void *onetouch_)
+static void onetouch_release_input(void *onetouch_)
 {
        struct usb_onetouch *onetouch = (struct usb_onetouch *) onetouch_;