]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/class/usblp.c
USB: remove err() macro from usb class drivers
[linux-2.6-omap-h63xx.git] / drivers / usb / class / usblp.c
index ad632f2d6f94534e61a5ff6241a9671f517b1eea..b5775af3ba26e4dc94db3b2ebb205abbfce4f2ea 100644 (file)
@@ -428,6 +428,7 @@ static int usblp_open(struct inode *inode, struct file *file)
        usblp->rcomplete = 0;
 
        if (handle_bidir(usblp) < 0) {
+               usb_autopm_put_interface(intf);
                usblp->used = 0;
                file->private_data = NULL;
                retval = -EIO;
@@ -592,8 +593,9 @@ static long usblp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                                err = usblp_hp_channel_change_request(usblp,
                                        arg, &newChannel);
                                if (err < 0) {
-                                       err("usblp%d: error = %d setting "
-                                               "HP channel",
+                                       dev_err(&usblp->dev->dev,
+                                               "usblp%d: error = %d setting "
+                                               "HP channel\n",
                                                usblp->minor, err);
                                        retval = -EIO;
                                        goto done;
@@ -1075,15 +1077,16 @@ static int usblp_probe(struct usb_interface *intf,
                       const struct usb_device_id *id)
 {
        struct usb_device *dev = interface_to_usbdev (intf);
-       struct usblp *usblp = NULL;
+       struct usblp *usblp;
        int protocol;
        int retval;
 
        /* Malloc and start initializing usblp structure so we can use it
         * directly. */
-       if (!(usblp = kzalloc(sizeof(struct usblp), GFP_KERNEL))) {
+       usblp = kzalloc(sizeof(struct usblp), GFP_KERNEL);
+       if (!usblp) {
                retval = -ENOMEM;
-               goto abort;
+               goto abort_ret;
        }
        usblp->dev = dev;
        mutex_init(&usblp->wmut);
@@ -1178,12 +1181,11 @@ abort_intfdata:
        usb_set_intfdata (intf, NULL);
        device_remove_file(&intf->dev, &dev_attr_ieee1284_id);
 abort:
-       if (usblp) {
-               kfree(usblp->readbuf);
-               kfree(usblp->statusbuf);
-               kfree(usblp->device_id_string);
-               kfree(usblp);
-       }
+       kfree(usblp->readbuf);
+       kfree(usblp->statusbuf);
+       kfree(usblp->device_id_string);
+       kfree(usblp);
+abort_ret:
        return retval;
 }
 
@@ -1344,7 +1346,7 @@ static void usblp_disconnect(struct usb_interface *intf)
        usb_deregister_dev(intf, &usblp_class);
 
        if (!usblp || !usblp->dev) {
-               err("bogus disconnect");
+               dev_err(&intf->dev, "bogus disconnect\n");
                BUG ();
        }