diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-04-20 19:53:48 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-04-20 19:53:48 -0400 |
| commit | 9d974b2a06e34646f1787a1bbc7ffe7de61c23ef (patch) | |
| tree | 8314d35106e56abfd06a1b768b5960a715b64602 /drivers/usb/misc | |
| parent | b22862e5197ea6471f37710bd3a853a4802c6bf4 (diff) | |
USB: legousbtower.c: remove err() usage
err() was a very old USB-specific macro that I thought had
gone away. This patch removes it from being used in the
driver and uses dev_err() instead.
CC: Juergen Stuber <starblue@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/misc')
| -rw-r--r-- | drivers/usb/misc/legousbtower.c | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c index 575222042767..a2702cbfe804 100644 --- a/drivers/usb/misc/legousbtower.c +++ b/drivers/usb/misc/legousbtower.c | |||
| @@ -354,8 +354,8 @@ static int tower_open (struct inode *inode, struct file *file) | |||
| 354 | interface = usb_find_interface (&tower_driver, subminor); | 354 | interface = usb_find_interface (&tower_driver, subminor); |
| 355 | 355 | ||
| 356 | if (!interface) { | 356 | if (!interface) { |
| 357 | err ("%s - error, can't find device for minor %d", | 357 | printk(KERN_ERR "%s - error, can't find device for minor %d\n", |
| 358 | __func__, subminor); | 358 | __func__, subminor); |
| 359 | retval = -ENODEV; | 359 | retval = -ENODEV; |
| 360 | goto exit; | 360 | goto exit; |
| 361 | } | 361 | } |
| @@ -397,7 +397,8 @@ static int tower_open (struct inode *inode, struct file *file) | |||
| 397 | sizeof(reset_reply), | 397 | sizeof(reset_reply), |
| 398 | 1000); | 398 | 1000); |
| 399 | if (result < 0) { | 399 | if (result < 0) { |
| 400 | err("LEGO USB Tower reset control request failed"); | 400 | dev_err(&dev->udev->dev, |
| 401 | "LEGO USB Tower reset control request failed\n"); | ||
| 401 | retval = result; | 402 | retval = result; |
| 402 | goto unlock_exit; | 403 | goto unlock_exit; |
| 403 | } | 404 | } |
| @@ -420,7 +421,8 @@ static int tower_open (struct inode *inode, struct file *file) | |||
| 420 | 421 | ||
| 421 | retval = usb_submit_urb (dev->interrupt_in_urb, GFP_KERNEL); | 422 | retval = usb_submit_urb (dev->interrupt_in_urb, GFP_KERNEL); |
| 422 | if (retval) { | 423 | if (retval) { |
| 423 | err("Couldn't submit interrupt_in_urb %d", retval); | 424 | dev_err(&dev->udev->dev, |
| 425 | "Couldn't submit interrupt_in_urb %d\n", retval); | ||
| 424 | dev->interrupt_in_running = 0; | 426 | dev->interrupt_in_running = 0; |
| 425 | dev->open_count = 0; | 427 | dev->open_count = 0; |
| 426 | goto unlock_exit; | 428 | goto unlock_exit; |
| @@ -608,7 +610,7 @@ static ssize_t tower_read (struct file *file, char __user *buffer, size_t count, | |||
| 608 | /* verify that the device wasn't unplugged */ | 610 | /* verify that the device wasn't unplugged */ |
| 609 | if (dev->udev == NULL) { | 611 | if (dev->udev == NULL) { |
| 610 | retval = -ENODEV; | 612 | retval = -ENODEV; |
| 611 | err("No device or device unplugged %d", retval); | 613 | printk(KERN_ERR "legousbtower: No device or device unplugged %d\n", retval); |
| 612 | goto unlock_exit; | 614 | goto unlock_exit; |
| 613 | } | 615 | } |
| 614 | 616 | ||
| @@ -697,7 +699,7 @@ static ssize_t tower_write (struct file *file, const char __user *buffer, size_t | |||
| 697 | /* verify that the device wasn't unplugged */ | 699 | /* verify that the device wasn't unplugged */ |
| 698 | if (dev->udev == NULL) { | 700 | if (dev->udev == NULL) { |
| 699 | retval = -ENODEV; | 701 | retval = -ENODEV; |
| 700 | err("No device or device unplugged %d", retval); | 702 | printk(KERN_ERR "legousbtower: No device or device unplugged %d\n", retval); |
| 701 | goto unlock_exit; | 703 | goto unlock_exit; |
| 702 | } | 704 | } |
| 703 | 705 | ||
| @@ -744,7 +746,8 @@ static ssize_t tower_write (struct file *file, const char __user *buffer, size_t | |||
| 744 | retval = usb_submit_urb (dev->interrupt_out_urb, GFP_KERNEL); | 746 | retval = usb_submit_urb (dev->interrupt_out_urb, GFP_KERNEL); |
| 745 | if (retval) { | 747 | if (retval) { |
| 746 | dev->interrupt_out_busy = 0; | 748 | dev->interrupt_out_busy = 0; |
| 747 | err("Couldn't submit interrupt_out_urb %d", retval); | 749 | dev_err(&dev->udev->dev, |
| 750 | "Couldn't submit interrupt_out_urb %d\n", retval); | ||
| 748 | goto unlock_exit; | 751 | goto unlock_exit; |
| 749 | } | 752 | } |
| 750 | retval = bytes_to_write; | 753 | retval = bytes_to_write; |
| @@ -803,9 +806,10 @@ resubmit: | |||
| 803 | /* resubmit if we're still running */ | 806 | /* resubmit if we're still running */ |
| 804 | if (dev->interrupt_in_running && dev->udev) { | 807 | if (dev->interrupt_in_running && dev->udev) { |
| 805 | retval = usb_submit_urb (dev->interrupt_in_urb, GFP_ATOMIC); | 808 | retval = usb_submit_urb (dev->interrupt_in_urb, GFP_ATOMIC); |
| 806 | if (retval) { | 809 | if (retval) |
| 807 | err("%s: usb_submit_urb failed (%d)", __func__, retval); | 810 | dev_err(&dev->udev->dev, |
| 808 | } | 811 | "%s: usb_submit_urb failed (%d)\n", |
| 812 | __func__, retval); | ||
| 809 | } | 813 | } |
| 810 | 814 | ||
| 811 | exit: | 815 | exit: |
| @@ -852,6 +856,7 @@ static void tower_interrupt_out_callback (struct urb *urb) | |||
| 852 | */ | 856 | */ |
| 853 | static int tower_probe (struct usb_interface *interface, const struct usb_device_id *id) | 857 | static int tower_probe (struct usb_interface *interface, const struct usb_device_id *id) |
| 854 | { | 858 | { |
| 859 | struct device *idev = &interface->dev; | ||
| 855 | struct usb_device *udev = interface_to_usbdev(interface); | 860 | struct usb_device *udev = interface_to_usbdev(interface); |
| 856 | struct lego_usb_tower *dev = NULL; | 861 | struct lego_usb_tower *dev = NULL; |
| 857 | struct usb_host_interface *iface_desc; | 862 | struct usb_host_interface *iface_desc; |
| @@ -871,7 +876,7 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device | |||
| 871 | dev = kmalloc (sizeof(struct lego_usb_tower), GFP_KERNEL); | 876 | dev = kmalloc (sizeof(struct lego_usb_tower), GFP_KERNEL); |
| 872 | 877 | ||
| 873 | if (dev == NULL) { | 878 | if (dev == NULL) { |
| 874 | err ("Out of memory"); | 879 | dev_err(idev, "Out of memory\n"); |
| 875 | goto exit; | 880 | goto exit; |
| 876 | } | 881 | } |
| 877 | 882 | ||
| @@ -915,37 +920,37 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device | |||
| 915 | } | 920 | } |
| 916 | } | 921 | } |
| 917 | if(dev->interrupt_in_endpoint == NULL) { | 922 | if(dev->interrupt_in_endpoint == NULL) { |
| 918 | err("interrupt in endpoint not found"); | 923 | dev_err(idev, "interrupt in endpoint not found\n"); |
| 919 | goto error; | 924 | goto error; |
| 920 | } | 925 | } |
| 921 | if (dev->interrupt_out_endpoint == NULL) { | 926 | if (dev->interrupt_out_endpoint == NULL) { |
| 922 | err("interrupt out endpoint not found"); | 927 | dev_err(idev, "interrupt out endpoint not found\n"); |
| 923 | goto error; | 928 | goto error; |
| 924 | } | 929 | } |
| 925 | 930 | ||
| 926 | dev->read_buffer = kmalloc (read_buffer_size, GFP_KERNEL); | 931 | dev->read_buffer = kmalloc (read_buffer_size, GFP_KERNEL); |
| 927 | if (!dev->read_buffer) { | 932 | if (!dev->read_buffer) { |
| 928 | err("Couldn't allocate read_buffer"); | 933 | dev_err(idev, "Couldn't allocate read_buffer\n"); |
| 929 | goto error; | 934 | goto error; |
| 930 | } | 935 | } |
| 931 | dev->interrupt_in_buffer = kmalloc (usb_endpoint_maxp(dev->interrupt_in_endpoint), GFP_KERNEL); | 936 | dev->interrupt_in_buffer = kmalloc (usb_endpoint_maxp(dev->interrupt_in_endpoint), GFP_KERNEL); |
| 932 | if (!dev->interrupt_in_buffer) { | 937 | if (!dev->interrupt_in_buffer) { |
| 933 | err("Couldn't allocate interrupt_in_buffer"); | 938 | dev_err(idev, "Couldn't allocate interrupt_in_buffer\n"); |
| 934 | goto error; | 939 | goto error; |
| 935 | } | 940 | } |
| 936 | dev->interrupt_in_urb = usb_alloc_urb(0, GFP_KERNEL); | 941 | dev->interrupt_in_urb = usb_alloc_urb(0, GFP_KERNEL); |
| 937 | if (!dev->interrupt_in_urb) { | 942 | if (!dev->interrupt_in_urb) { |
| 938 | err("Couldn't allocate interrupt_in_urb"); | 943 | dev_err(idev, "Couldn't allocate interrupt_in_urb\n"); |
| 939 | goto error; | 944 | goto error; |
| 940 | } | 945 | } |
| 941 | dev->interrupt_out_buffer = kmalloc (write_buffer_size, GFP_KERNEL); | 946 | dev->interrupt_out_buffer = kmalloc (write_buffer_size, GFP_KERNEL); |
| 942 | if (!dev->interrupt_out_buffer) { | 947 | if (!dev->interrupt_out_buffer) { |
| 943 | err("Couldn't allocate interrupt_out_buffer"); | 948 | dev_err(idev, "Couldn't allocate interrupt_out_buffer\n"); |
| 944 | goto error; | 949 | goto error; |
| 945 | } | 950 | } |
| 946 | dev->interrupt_out_urb = usb_alloc_urb(0, GFP_KERNEL); | 951 | dev->interrupt_out_urb = usb_alloc_urb(0, GFP_KERNEL); |
| 947 | if (!dev->interrupt_out_urb) { | 952 | if (!dev->interrupt_out_urb) { |
| 948 | err("Couldn't allocate interrupt_out_urb"); | 953 | dev_err(idev, "Couldn't allocate interrupt_out_urb\n"); |
| 949 | goto error; | 954 | goto error; |
| 950 | } | 955 | } |
| 951 | dev->interrupt_in_interval = interrupt_in_interval ? interrupt_in_interval : dev->interrupt_in_endpoint->bInterval; | 956 | dev->interrupt_in_interval = interrupt_in_interval ? interrupt_in_interval : dev->interrupt_in_endpoint->bInterval; |
| @@ -958,7 +963,7 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device | |||
| 958 | 963 | ||
| 959 | if (retval) { | 964 | if (retval) { |
| 960 | /* something prevented us from registering this driver */ | 965 | /* something prevented us from registering this driver */ |
| 961 | err ("Not able to get a minor for this device."); | 966 | dev_err(idev, "Not able to get a minor for this device.\n"); |
| 962 | usb_set_intfdata (interface, NULL); | 967 | usb_set_intfdata (interface, NULL); |
| 963 | goto error; | 968 | goto error; |
| 964 | } | 969 | } |
| @@ -980,7 +985,7 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device | |||
| 980 | sizeof(get_version_reply), | 985 | sizeof(get_version_reply), |
| 981 | 1000); | 986 | 1000); |
| 982 | if (result < 0) { | 987 | if (result < 0) { |
| 983 | err("LEGO USB Tower get version control request failed"); | 988 | dev_err(idev, "LEGO USB Tower get version control request failed\n"); |
| 984 | retval = result; | 989 | retval = result; |
| 985 | goto error; | 990 | goto error; |
| 986 | } | 991 | } |
