Commit 6b968737 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Felipe Balbi

usb: gadged: pch_udc: get rid of redundant assignments

It seems there are leftovers of some assignments which are not used
anymore.  Compiler even warns us about:

drivers/usb/gadget/udc/pch_udc.c:2022:22: warning: variable ‘dev’ set \
but not used [-Wunused-but-set-variable]

drivers/usb/gadget/udc/pch_udc.c:2639:9: warning: variable ‘ret’ set \
but not used [-Wunused-but-set-variable]

Remove them and shut compiler about.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent c7b640d2
...@@ -1719,14 +1719,12 @@ static int pch_udc_pcd_ep_enable(struct usb_ep *usbep, ...@@ -1719,14 +1719,12 @@ static int pch_udc_pcd_ep_enable(struct usb_ep *usbep,
static int pch_udc_pcd_ep_disable(struct usb_ep *usbep) static int pch_udc_pcd_ep_disable(struct usb_ep *usbep)
{ {
struct pch_udc_ep *ep; struct pch_udc_ep *ep;
struct pch_udc_dev *dev;
unsigned long iflags; unsigned long iflags;
if (!usbep) if (!usbep)
return -EINVAL; return -EINVAL;
ep = container_of(usbep, struct pch_udc_ep, ep); ep = container_of(usbep, struct pch_udc_ep, ep);
dev = ep->dev;
if ((usbep->name == ep0_string) || !ep->ep.desc) if ((usbep->name == ep0_string) || !ep->ep.desc)
return -EINVAL; return -EINVAL;
...@@ -1757,12 +1755,10 @@ static struct usb_request *pch_udc_alloc_request(struct usb_ep *usbep, ...@@ -1757,12 +1755,10 @@ static struct usb_request *pch_udc_alloc_request(struct usb_ep *usbep,
struct pch_udc_request *req; struct pch_udc_request *req;
struct pch_udc_ep *ep; struct pch_udc_ep *ep;
struct pch_udc_data_dma_desc *dma_desc; struct pch_udc_data_dma_desc *dma_desc;
struct pch_udc_dev *dev;
if (!usbep) if (!usbep)
return NULL; return NULL;
ep = container_of(usbep, struct pch_udc_ep, ep); ep = container_of(usbep, struct pch_udc_ep, ep);
dev = ep->dev;
req = kzalloc(sizeof *req, gfp); req = kzalloc(sizeof *req, gfp);
if (!req) if (!req)
return NULL; return NULL;
...@@ -1935,12 +1931,10 @@ static int pch_udc_pcd_dequeue(struct usb_ep *usbep, ...@@ -1935,12 +1931,10 @@ static int pch_udc_pcd_dequeue(struct usb_ep *usbep,
{ {
struct pch_udc_ep *ep; struct pch_udc_ep *ep;
struct pch_udc_request *req; struct pch_udc_request *req;
struct pch_udc_dev *dev;
unsigned long flags; unsigned long flags;
int ret = -EINVAL; int ret = -EINVAL;
ep = container_of(usbep, struct pch_udc_ep, ep); ep = container_of(usbep, struct pch_udc_ep, ep);
dev = ep->dev;
if (!usbep || !usbreq || (!ep->ep.desc && ep->num)) if (!usbep || !usbreq || (!ep->ep.desc && ep->num))
return ret; return ret;
req = container_of(usbreq, struct pch_udc_request, req); req = container_of(usbreq, struct pch_udc_request, req);
...@@ -1972,14 +1966,12 @@ static int pch_udc_pcd_dequeue(struct usb_ep *usbep, ...@@ -1972,14 +1966,12 @@ static int pch_udc_pcd_dequeue(struct usb_ep *usbep,
static int pch_udc_pcd_set_halt(struct usb_ep *usbep, int halt) static int pch_udc_pcd_set_halt(struct usb_ep *usbep, int halt)
{ {
struct pch_udc_ep *ep; struct pch_udc_ep *ep;
struct pch_udc_dev *dev;
unsigned long iflags; unsigned long iflags;
int ret; int ret;
if (!usbep) if (!usbep)
return -EINVAL; return -EINVAL;
ep = container_of(usbep, struct pch_udc_ep, ep); ep = container_of(usbep, struct pch_udc_ep, ep);
dev = ep->dev;
if (!ep->ep.desc && !ep->num) if (!ep->ep.desc && !ep->num)
return -EINVAL; return -EINVAL;
if (!ep->dev->driver || (ep->dev->gadget.speed == USB_SPEED_UNKNOWN)) if (!ep->dev->driver || (ep->dev->gadget.speed == USB_SPEED_UNKNOWN))
...@@ -2017,14 +2009,12 @@ static int pch_udc_pcd_set_halt(struct usb_ep *usbep, int halt) ...@@ -2017,14 +2009,12 @@ static int pch_udc_pcd_set_halt(struct usb_ep *usbep, int halt)
static int pch_udc_pcd_set_wedge(struct usb_ep *usbep) static int pch_udc_pcd_set_wedge(struct usb_ep *usbep)
{ {
struct pch_udc_ep *ep; struct pch_udc_ep *ep;
struct pch_udc_dev *dev;
unsigned long iflags; unsigned long iflags;
int ret; int ret;
if (!usbep) if (!usbep)
return -EINVAL; return -EINVAL;
ep = container_of(usbep, struct pch_udc_ep, ep); ep = container_of(usbep, struct pch_udc_ep, ep);
dev = ep->dev;
if (!ep->ep.desc && !ep->num) if (!ep->ep.desc && !ep->num)
return -EINVAL; return -EINVAL;
if (!ep->dev->driver || (ep->dev->gadget.speed == USB_SPEED_UNKNOWN)) if (!ep->dev->driver || (ep->dev->gadget.speed == USB_SPEED_UNKNOWN))
...@@ -2634,7 +2624,7 @@ static void pch_udc_svc_enum_interrupt(struct pch_udc_dev *dev) ...@@ -2634,7 +2624,7 @@ static void pch_udc_svc_enum_interrupt(struct pch_udc_dev *dev)
static void pch_udc_svc_intf_interrupt(struct pch_udc_dev *dev) static void pch_udc_svc_intf_interrupt(struct pch_udc_dev *dev)
{ {
u32 reg, dev_stat = 0; u32 reg, dev_stat = 0;
int i, ret; int i;
dev_stat = pch_udc_read_device_status(dev); dev_stat = pch_udc_read_device_status(dev);
dev->cfg_data.cur_intf = (dev_stat & UDC_DEVSTS_INTF_MASK) >> dev->cfg_data.cur_intf = (dev_stat & UDC_DEVSTS_INTF_MASK) >>
...@@ -2663,7 +2653,7 @@ static void pch_udc_svc_intf_interrupt(struct pch_udc_dev *dev) ...@@ -2663,7 +2653,7 @@ static void pch_udc_svc_intf_interrupt(struct pch_udc_dev *dev)
} }
dev->stall = 0; dev->stall = 0;
spin_lock(&dev->lock); spin_lock(&dev->lock);
ret = dev->driver->setup(&dev->gadget, &dev->setup_data); dev->driver->setup(&dev->gadget, &dev->setup_data);
spin_unlock(&dev->lock); spin_unlock(&dev->lock);
} }
...@@ -2674,7 +2664,7 @@ static void pch_udc_svc_intf_interrupt(struct pch_udc_dev *dev) ...@@ -2674,7 +2664,7 @@ static void pch_udc_svc_intf_interrupt(struct pch_udc_dev *dev)
*/ */
static void pch_udc_svc_cfg_interrupt(struct pch_udc_dev *dev) static void pch_udc_svc_cfg_interrupt(struct pch_udc_dev *dev)
{ {
int i, ret; int i;
u32 reg, dev_stat = 0; u32 reg, dev_stat = 0;
dev_stat = pch_udc_read_device_status(dev); dev_stat = pch_udc_read_device_status(dev);
...@@ -2700,7 +2690,7 @@ static void pch_udc_svc_cfg_interrupt(struct pch_udc_dev *dev) ...@@ -2700,7 +2690,7 @@ static void pch_udc_svc_cfg_interrupt(struct pch_udc_dev *dev)
/* call gadget zero with setup data received */ /* call gadget zero with setup data received */
spin_lock(&dev->lock); spin_lock(&dev->lock);
ret = dev->driver->setup(&dev->gadget, &dev->setup_data); dev->driver->setup(&dev->gadget, &dev->setup_data);
spin_unlock(&dev->lock); spin_unlock(&dev->lock);
} }
......
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