Commit fd784cad authored by Guido Kiener's avatar Guido Kiener Committed by Greg Kroah-Hartman

usb: usbtmc: Remove redundant code

Remove redundant code and fix debug messages.
Signed-off-by: default avatarGuido Kiener <guido.kiener@rohde-schwarz.com>
Reviewed-by: default avatarSteve Bayless <steve_bayless@keysight.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent dfce4839
...@@ -1745,12 +1745,9 @@ static int usbtmc_ioctl_clear_out_halt(struct usbtmc_device_data *data) ...@@ -1745,12 +1745,9 @@ static int usbtmc_ioctl_clear_out_halt(struct usbtmc_device_data *data)
rv = usb_clear_halt(data->usb_dev, rv = usb_clear_halt(data->usb_dev,
usb_sndbulkpipe(data->usb_dev, data->bulk_out)); usb_sndbulkpipe(data->usb_dev, data->bulk_out));
if (rv < 0) { if (rv < 0)
dev_err(&data->usb_dev->dev, "usb_control_msg returned %d\n", dev_err(&data->usb_dev->dev, "%s returned %d\n", __func__, rv);
rv); return rv;
return rv;
}
return 0;
} }
static int usbtmc_ioctl_clear_in_halt(struct usbtmc_device_data *data) static int usbtmc_ioctl_clear_in_halt(struct usbtmc_device_data *data)
...@@ -1760,12 +1757,9 @@ static int usbtmc_ioctl_clear_in_halt(struct usbtmc_device_data *data) ...@@ -1760,12 +1757,9 @@ static int usbtmc_ioctl_clear_in_halt(struct usbtmc_device_data *data)
rv = usb_clear_halt(data->usb_dev, rv = usb_clear_halt(data->usb_dev,
usb_rcvbulkpipe(data->usb_dev, data->bulk_in)); usb_rcvbulkpipe(data->usb_dev, data->bulk_in));
if (rv < 0) { if (rv < 0)
dev_err(&data->usb_dev->dev, "usb_control_msg returned %d\n", dev_err(&data->usb_dev->dev, "%s returned %d\n", __func__, rv);
rv); return rv;
return rv;
}
return 0;
} }
static int usbtmc_ioctl_cancel_io(struct usbtmc_file_data *file_data) static int usbtmc_ioctl_cancel_io(struct usbtmc_file_data *file_data)
...@@ -2189,11 +2183,8 @@ static long usbtmc_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -2189,11 +2183,8 @@ static long usbtmc_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
break; break;
case USBTMC488_IOCTL_GET_CAPS: case USBTMC488_IOCTL_GET_CAPS:
retval = copy_to_user((void __user *)arg, retval = put_user(data->usb488_caps,
&data->usb488_caps, (unsigned char __user *)arg);
sizeof(data->usb488_caps));
if (retval)
retval = -EFAULT;
break; break;
case USBTMC488_IOCTL_READ_STB: case USBTMC488_IOCTL_READ_STB:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment