Commit be8a8ca3 authored by Christian Gromm's avatar Christian Gromm Committed by Greg Kroah-Hartman

staging: most: usb: remove local variable

This patch removes the local variable dev that is used to store the pointer
to the usb_device whenever it is used only once.
Signed-off-by: default avatarChristian Gromm <christian.gromm@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c06b99e0
...@@ -338,7 +338,6 @@ static void hdm_write_completion(struct urb *urb) ...@@ -338,7 +338,6 @@ static void hdm_write_completion(struct urb *urb)
struct mbo *mbo = urb->context; struct mbo *mbo = urb->context;
struct most_dev *mdev = to_mdev(mbo->ifp); struct most_dev *mdev = to_mdev(mbo->ifp);
unsigned int channel = mbo->hdm_channel_id; unsigned int channel = mbo->hdm_channel_id;
struct device *dev = &mdev->usb_device->dev;
spinlock_t *lock = mdev->channel_lock + channel; spinlock_t *lock = mdev->channel_lock + channel;
unsigned long flags; unsigned long flags;
...@@ -354,7 +353,8 @@ static void hdm_write_completion(struct urb *urb) ...@@ -354,7 +353,8 @@ static void hdm_write_completion(struct urb *urb)
mbo->status = MBO_SUCCESS; mbo->status = MBO_SUCCESS;
break; break;
case -EPIPE: case -EPIPE:
dev_warn(dev, "Broken pipe on ep%02x\n", dev_warn(&mdev->usb_device->dev,
"Broken pipe on ep%02x\n",
mdev->ep_address[channel]); mdev->ep_address[channel]);
mdev->is_channel_healthy[channel] = false; mdev->is_channel_healthy[channel] = false;
mdev->clear_work[channel].pipe = urb->pipe; mdev->clear_work[channel].pipe = urb->pipe;
...@@ -552,7 +552,6 @@ static int hdm_enqueue(struct most_interface *iface, int channel, ...@@ -552,7 +552,6 @@ static int hdm_enqueue(struct most_interface *iface, int channel,
{ {
struct most_dev *mdev; struct most_dev *mdev;
struct most_channel_config *conf; struct most_channel_config *conf;
struct device *dev;
int retval = 0; int retval = 0;
struct urb *urb; struct urb *urb;
unsigned long length; unsigned long length;
...@@ -572,7 +571,6 @@ static int hdm_enqueue(struct most_interface *iface, int channel, ...@@ -572,7 +571,6 @@ static int hdm_enqueue(struct most_interface *iface, int channel,
goto _exit; goto _exit;
} }
dev = &mdev->usb_device->dev;
urb = usb_alloc_urb(NO_ISOCHRONOUS_URB, GFP_ATOMIC); urb = usb_alloc_urb(NO_ISOCHRONOUS_URB, GFP_ATOMIC);
if (!urb) { if (!urb) {
retval = -ENOMEM; retval = -ENOMEM;
...@@ -615,7 +613,8 @@ static int hdm_enqueue(struct most_interface *iface, int channel, ...@@ -615,7 +613,8 @@ static int hdm_enqueue(struct most_interface *iface, int channel,
retval = usb_submit_urb(urb, GFP_KERNEL); retval = usb_submit_urb(urb, GFP_KERNEL);
if (retval) { if (retval) {
dev_err(dev, "URB submit failed with error %d.\n", retval); dev_err(&mdev->usb_device->dev,
"URB submit failed with error %d.\n", retval);
goto _error_1; goto _error_1;
} }
goto _exit; goto _exit;
......
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