Commit 329a5403 authored by Tony Lindgren's avatar Tony Lindgren

musb_hdrc: Search and replace Lock with lock

Search and replace Lock with lock
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent b5f3c4b5
...@@ -210,7 +210,7 @@ static void otg_timer(unsigned long _musb) ...@@ -210,7 +210,7 @@ static void otg_timer(unsigned long _musb)
devctl = musb_readb(mregs, MGC_O_HDRC_DEVCTL); devctl = musb_readb(mregs, MGC_O_HDRC_DEVCTL);
DBG(7, "poll devctl %02x (%s)\n", devctl, otg_state_string(musb)); DBG(7, "poll devctl %02x (%s)\n", devctl, otg_state_string(musb));
spin_lock_irqsave(&musb->Lock, flags); spin_lock_irqsave(&musb->lock, flags);
switch (musb->xceiv.state) { switch (musb->xceiv.state) {
case OTG_STATE_A_WAIT_VFALL: case OTG_STATE_A_WAIT_VFALL:
/* Wait till VBUS falls below SessionEnd (~0.2V); the 1.3 RTL /* Wait till VBUS falls below SessionEnd (~0.2V); the 1.3 RTL
...@@ -252,7 +252,7 @@ static void otg_timer(unsigned long _musb) ...@@ -252,7 +252,7 @@ static void otg_timer(unsigned long _musb)
default: default:
break; break;
} }
spin_unlock_irqrestore(&musb->Lock, flags); spin_unlock_irqrestore(&musb->lock, flags);
} }
static irqreturn_t davinci_interrupt(int irq, void *__hci) static irqreturn_t davinci_interrupt(int irq, void *__hci)
...@@ -263,7 +263,7 @@ static irqreturn_t davinci_interrupt(int irq, void *__hci) ...@@ -263,7 +263,7 @@ static irqreturn_t davinci_interrupt(int irq, void *__hci)
void *__iomem tibase = musb->ctrl_base; void *__iomem tibase = musb->ctrl_base;
u32 tmp; u32 tmp;
spin_lock_irqsave(&musb->Lock, flags); spin_lock_irqsave(&musb->lock, flags);
/* NOTE: DaVinci shadows the Mentor IRQs. Don't manage them through /* NOTE: DaVinci shadows the Mentor IRQs. Don't manage them through
* the Mentor registers (except for setup), use the TI ones and EOI. * the Mentor registers (except for setup), use the TI ones and EOI.
...@@ -366,7 +366,7 @@ static irqreturn_t davinci_interrupt(int irq, void *__hci) ...@@ -366,7 +366,7 @@ static irqreturn_t davinci_interrupt(int irq, void *__hci)
&& musb->xceiv.state == OTG_STATE_B_IDLE) && musb->xceiv.state == OTG_STATE_B_IDLE)
mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ); mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ);
spin_unlock_irqrestore(&musb->Lock, flags); spin_unlock_irqrestore(&musb->lock, flags);
/* REVISIT we sometimes get unhandled IRQs /* REVISIT we sometimes get unhandled IRQs
* (e.g. ep0). not clear why... * (e.g. ep0). not clear why...
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#define next_ep0_request(musb) next_in_request(&(musb)->endpoints[0]) #define next_ep0_request(musb) next_in_request(&(musb)->endpoints[0])
/* /*
* Locking note: we use only the controller lock, for simpler correctness. * locking note: we use only the controller lock, for simpler correctness.
* It's always held with IRQs blocked. * It's always held with IRQs blocked.
* *
* It protects the ep0 request queue as well as ep0_state, not just the * It protects the ep0 request queue as well as ep0_state, not just the
...@@ -226,8 +226,8 @@ static inline void musb_try_b_hnp_enable(struct musb *musb) ...@@ -226,8 +226,8 @@ static inline void musb_try_b_hnp_enable(struct musb *musb)
static int static int
service_zero_data_request(struct musb *musb, service_zero_data_request(struct musb *musb,
struct usb_ctrlrequest *pControlRequest) struct usb_ctrlrequest *pControlRequest)
__releases(musb->Lock) __releases(musb->lock)
__acquires(musb->Lock) __acquires(musb->lock)
{ {
int handled = -EINVAL; int handled = -EINVAL;
void __iomem *mbase = musb->mregs; void __iomem *mbase = musb->mregs;
...@@ -273,9 +273,9 @@ __acquires(musb->Lock) ...@@ -273,9 +273,9 @@ __acquires(musb->Lock)
break; break;
/* REVISIT do it directly, no locking games */ /* REVISIT do it directly, no locking games */
spin_unlock(&musb->Lock); spin_unlock(&musb->lock);
musb_gadget_set_halt(&musb_ep->end_point, 0); musb_gadget_set_halt(&musb_ep->end_point, 0);
spin_lock(&musb->Lock); spin_lock(&musb->lock);
/* select ep0 again */ /* select ep0 again */
MGC_SelectEnd(mbase, 0); MGC_SelectEnd(mbase, 0);
...@@ -579,15 +579,15 @@ musb_read_setup(struct musb *musb, struct usb_ctrlrequest *req) ...@@ -579,15 +579,15 @@ musb_read_setup(struct musb *musb, struct usb_ctrlrequest *req)
static int static int
forward_to_driver(struct musb *musb, forward_to_driver(struct musb *musb,
const struct usb_ctrlrequest *pControlRequest) const struct usb_ctrlrequest *pControlRequest)
__releases(musb->Lock) __releases(musb->lock)
__acquires(musb->Lock) __acquires(musb->lock)
{ {
int retval; int retval;
if (!musb->pGadgetDriver) if (!musb->pGadgetDriver)
return -EOPNOTSUPP; return -EOPNOTSUPP;
spin_unlock(&musb->Lock); spin_unlock(&musb->lock);
retval = musb->pGadgetDriver->setup(&musb->g, pControlRequest); retval = musb->pGadgetDriver->setup(&musb->g, pControlRequest);
spin_lock(&musb->Lock); spin_lock(&musb->lock);
return retval; return retval;
} }
...@@ -837,7 +837,7 @@ musb_g_ep0_queue(struct usb_ep *e, struct usb_request *r, gfp_t gfp_flags) ...@@ -837,7 +837,7 @@ musb_g_ep0_queue(struct usb_ep *e, struct usb_request *r, gfp_t gfp_flags)
req->request.status = -EINPROGRESS; req->request.status = -EINPROGRESS;
req->bTx = ep->is_in; req->bTx = ep->is_in;
spin_lock_irqsave(&musb->Lock, lockflags); spin_lock_irqsave(&musb->lock, lockflags);
if (!list_empty(&ep->req_list)) { if (!list_empty(&ep->req_list)) {
status = -EBUSY; status = -EBUSY;
...@@ -892,7 +892,7 @@ musb_g_ep0_queue(struct usb_ep *e, struct usb_request *r, gfp_t gfp_flags) ...@@ -892,7 +892,7 @@ musb_g_ep0_queue(struct usb_ep *e, struct usb_request *r, gfp_t gfp_flags)
} }
cleanup: cleanup:
spin_unlock_irqrestore(&musb->Lock, lockflags); spin_unlock_irqrestore(&musb->lock, lockflags);
return status; return status;
} }
...@@ -920,7 +920,7 @@ static int musb_g_ep0_halt(struct usb_ep *e, int value) ...@@ -920,7 +920,7 @@ static int musb_g_ep0_halt(struct usb_ep *e, int value)
base = musb->mregs; base = musb->mregs;
regs = musb->control_ep->regs; regs = musb->control_ep->regs;
spin_lock_irqsave(&musb->Lock, flags); spin_lock_irqsave(&musb->lock, flags);
if (!list_empty(&ep->req_list)) { if (!list_empty(&ep->req_list)) {
status = -EBUSY; status = -EBUSY;
...@@ -945,7 +945,7 @@ static int musb_g_ep0_halt(struct usb_ep *e, int value) ...@@ -945,7 +945,7 @@ static int musb_g_ep0_halt(struct usb_ep *e, int value)
} }
cleanup: cleanup:
spin_unlock_irqrestore(&musb->Lock, flags); spin_unlock_irqrestore(&musb->lock, flags);
return status; return status;
} }
......
This diff is collapsed.
...@@ -267,8 +267,8 @@ start: ...@@ -267,8 +267,8 @@ start:
/* caller owns controller lock, irqs are blocked */ /* caller owns controller lock, irqs are blocked */
static void static void
__musb_giveback(struct musb *musb, struct urb *urb, int status) __musb_giveback(struct musb *musb, struct urb *urb, int status)
__releases(musb->Lock) __releases(musb->lock)
__acquires(musb->Lock) __acquires(musb->lock)
{ {
if ((urb->transfer_flags & URB_SHORT_NOT_OK) if ((urb->transfer_flags & URB_SHORT_NOT_OK)
&& (urb->actual_length < urb->transfer_buffer_length) && (urb->actual_length < urb->transfer_buffer_length)
...@@ -305,9 +305,9 @@ __acquires(musb->Lock) ...@@ -305,9 +305,9 @@ __acquires(musb->Lock)
urb->actual_length, urb->transfer_buffer_length urb->actual_length, urb->transfer_buffer_length
); );
spin_unlock(&musb->Lock); spin_unlock(&musb->lock);
usb_hcd_giveback_urb(musb_to_hcd(musb), urb); usb_hcd_giveback_urb(musb_to_hcd(musb), urb);
spin_lock(&musb->Lock); spin_lock(&musb->lock);
} }
/* for bulk/interrupt endpoints only */ /* for bulk/interrupt endpoints only */
...@@ -1868,7 +1868,7 @@ static int musb_urb_enqueue( ...@@ -1868,7 +1868,7 @@ static int musb_urb_enqueue(
* until we get real dma queues (with an entry for each urb/buffer), * until we get real dma queues (with an entry for each urb/buffer),
* we only have work to do in the former case. * we only have work to do in the former case.
*/ */
spin_lock_irqsave(&musb->Lock, flags); spin_lock_irqsave(&musb->lock, flags);
if (hep->hcpriv) { if (hep->hcpriv) {
/* some concurrent activity submitted another urb to hep... /* some concurrent activity submitted another urb to hep...
* odd, rare, error prone, but legal. * odd, rare, error prone, but legal.
...@@ -1885,7 +1885,7 @@ static int musb_urb_enqueue( ...@@ -1885,7 +1885,7 @@ static int musb_urb_enqueue(
* musb_start_urb(), but otherwise only konicawc cares ... * musb_start_urb(), but otherwise only konicawc cares ...
*/ */
} }
spin_unlock_irqrestore(&musb->Lock, flags); spin_unlock_irqrestore(&musb->lock, flags);
done: done:
if (status != 0) if (status != 0)
...@@ -1968,7 +1968,7 @@ static int musb_urb_dequeue(struct usb_hcd *hcd, struct urb *urb) ...@@ -1968,7 +1968,7 @@ static int musb_urb_dequeue(struct usb_hcd *hcd, struct urb *urb)
usb_pipeendpoint(urb->pipe), usb_pipeendpoint(urb->pipe),
usb_pipein(urb->pipe) ? "in" : "out"); usb_pipein(urb->pipe) ? "in" : "out");
spin_lock_irqsave(&musb->Lock, flags); spin_lock_irqsave(&musb->lock, flags);
/* make sure the urb is still queued and not completed */ /* make sure the urb is still queued and not completed */
spin_lock(&urb->lock); spin_lock(&urb->lock);
...@@ -2039,7 +2039,7 @@ static int musb_urb_dequeue(struct usb_hcd *hcd, struct urb *urb) ...@@ -2039,7 +2039,7 @@ static int musb_urb_dequeue(struct usb_hcd *hcd, struct urb *urb)
} else } else
status = musb_cleanup_urb(urb, qh, urb->pipe & USB_DIR_IN); status = musb_cleanup_urb(urb, qh, urb->pipe & USB_DIR_IN);
done: done:
spin_unlock_irqrestore(&musb->Lock, flags); spin_unlock_irqrestore(&musb->lock, flags);
return status; return status;
} }
...@@ -2058,7 +2058,7 @@ musb_h_disable(struct usb_hcd *hcd, struct usb_host_endpoint *hep) ...@@ -2058,7 +2058,7 @@ musb_h_disable(struct usb_hcd *hcd, struct usb_host_endpoint *hep)
if (!qh) if (!qh)
return; return;
spin_lock_irqsave(&musb->Lock, flags); spin_lock_irqsave(&musb->lock, flags);
switch (qh->type) { switch (qh->type) {
case USB_ENDPOINT_XFER_CONTROL: case USB_ENDPOINT_XFER_CONTROL:
...@@ -2100,7 +2100,7 @@ musb_h_disable(struct usb_hcd *hcd, struct usb_host_endpoint *hep) ...@@ -2100,7 +2100,7 @@ musb_h_disable(struct usb_hcd *hcd, struct usb_host_endpoint *hep)
list_for_each_entry_safe_from(urb, tmp, &hep->urb_list, urb_list) list_for_each_entry_safe_from(urb, tmp, &hep->urb_list, urb_list)
musb_giveback(qh, urb, -ESHUTDOWN); musb_giveback(qh, urb, -ESHUTDOWN);
spin_unlock_irqrestore(&musb->Lock, flags); spin_unlock_irqrestore(&musb->lock, flags);
} }
static int musb_h_get_frame_number(struct usb_hcd *hcd) static int musb_h_get_frame_number(struct usb_hcd *hcd)
......
...@@ -792,7 +792,7 @@ static int musb_proc_read(char *page, char **start, ...@@ -792,7 +792,7 @@ static int musb_proc_read(char *page, char **start,
if (count <= 0) if (count <= 0)
return -EINVAL; return -EINVAL;
spin_lock_irqsave(&musb->Lock, flags); spin_lock_irqsave(&musb->lock, flags);
code = dump_header_stats(musb, buffer); code = dump_header_stats(musb, buffer);
if (code > 0) { if (code > 0) {
...@@ -813,7 +813,7 @@ static int musb_proc_read(char *page, char **start, ...@@ -813,7 +813,7 @@ static int musb_proc_read(char *page, char **start,
musb_platform_try_idle(musb, 0); musb_platform_try_idle(musb, 0);
spin_unlock_irqrestore(&musb->Lock, flags); spin_unlock_irqrestore(&musb->lock, flags);
*eof = 1; *eof = 1;
return buffer - page; return buffer - page;
......
...@@ -342,7 +342,7 @@ static inline struct usb_request *next_out_request(struct musb_hw_ep *hw_ep) ...@@ -342,7 +342,7 @@ static inline struct usb_request *next_out_request(struct musb_hw_ep *hw_ep)
* struct musb - Driver instance data. * struct musb - Driver instance data.
*/ */
struct musb { struct musb {
spinlock_t Lock; spinlock_t lock;
struct clk *clock; struct clk *clock;
irqreturn_t (*isr)(int, void *); irqreturn_t (*isr)(int, void *);
struct work_struct irq_work; struct work_struct irq_work;
......
...@@ -297,14 +297,14 @@ void musb_otg_timer_func(unsigned long data) ...@@ -297,14 +297,14 @@ void musb_otg_timer_func(unsigned long data)
struct musb *musb = (struct musb *)data; struct musb *musb = (struct musb *)data;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&musb->Lock, flags); spin_lock_irqsave(&musb->lock, flags);
if (musb->xceiv.state == OTG_STATE_B_WAIT_ACON) { if (musb->xceiv.state == OTG_STATE_B_WAIT_ACON) {
DBG(1, "HNP: B_WAIT_ACON timeout, going back to B_PERIPHERAL\n"); DBG(1, "HNP: B_WAIT_ACON timeout, going back to B_PERIPHERAL\n");
musb_g_disconnect(musb); musb_g_disconnect(musb);
musb->xceiv.state = OTG_STATE_B_PERIPHERAL; musb->xceiv.state = OTG_STATE_B_PERIPHERAL;
musb->is_active = 0; musb->is_active = 0;
} }
spin_unlock_irqrestore(&musb->Lock, flags); spin_unlock_irqrestore(&musb->lock, flags);
} }
static DEFINE_TIMER(musb_otg_timer, musb_otg_timer_func, 0, 0); static DEFINE_TIMER(musb_otg_timer, musb_otg_timer_func, 0, 0);
...@@ -882,14 +882,14 @@ static void musb_shutdown(struct platform_device *pdev) ...@@ -882,14 +882,14 @@ static void musb_shutdown(struct platform_device *pdev)
struct musb *musb = dev_to_musb(&pdev->dev); struct musb *musb = dev_to_musb(&pdev->dev);
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&musb->Lock, flags); spin_lock_irqsave(&musb->lock, flags);
musb_platform_disable(musb); musb_platform_disable(musb);
musb_generic_disable(musb); musb_generic_disable(musb);
if (musb->clock) { if (musb->clock) {
clk_put(musb->clock); clk_put(musb->clock);
musb->clock = NULL; musb->clock = NULL;
} }
spin_unlock_irqrestore(&musb->Lock, flags); spin_unlock_irqrestore(&musb->lock, flags);
/* FIXME power down */ /* FIXME power down */
} }
...@@ -1419,7 +1419,7 @@ static irqreturn_t generic_interrupt(int irq, void *__hci) ...@@ -1419,7 +1419,7 @@ static irqreturn_t generic_interrupt(int irq, void *__hci)
irqreturn_t retval = IRQ_NONE; irqreturn_t retval = IRQ_NONE;
struct musb *musb = __hci; struct musb *musb = __hci;
spin_lock_irqsave(&musb->Lock, flags); spin_lock_irqsave(&musb->lock, flags);
musb->int_usb = musb_readb(musb->mregs, MGC_O_HDRC_INTRUSB); musb->int_usb = musb_readb(musb->mregs, MGC_O_HDRC_INTRUSB);
musb->int_tx = musb_readw(musb->mregs, MGC_O_HDRC_INTRTX); musb->int_tx = musb_readw(musb->mregs, MGC_O_HDRC_INTRTX);
...@@ -1428,7 +1428,7 @@ static irqreturn_t generic_interrupt(int irq, void *__hci) ...@@ -1428,7 +1428,7 @@ static irqreturn_t generic_interrupt(int irq, void *__hci)
if (musb->int_usb || musb->int_tx || musb->int_rx) if (musb->int_usb || musb->int_tx || musb->int_rx)
retval = musb_interrupt(musb); retval = musb_interrupt(musb);
spin_unlock_irqrestore(&musb->Lock, flags); spin_unlock_irqrestore(&musb->lock, flags);
/* REVISIT we sometimes get spurious IRQs on g_ep0 /* REVISIT we sometimes get spurious IRQs on g_ep0
* not clear why... * not clear why...
...@@ -1592,9 +1592,9 @@ musb_mode_show(struct device *dev, struct device_attribute *attr, char *buf) ...@@ -1592,9 +1592,9 @@ musb_mode_show(struct device *dev, struct device_attribute *attr, char *buf)
unsigned long flags; unsigned long flags;
int ret = -EINVAL; int ret = -EINVAL;
spin_lock_irqsave(&musb->Lock, flags); spin_lock_irqsave(&musb->lock, flags);
ret = sprintf(buf, "%s\n", otg_state_string(musb)); ret = sprintf(buf, "%s\n", otg_state_string(musb));
spin_unlock_irqrestore(&musb->Lock, flags); spin_unlock_irqrestore(&musb->lock, flags);
return ret; return ret;
} }
...@@ -1606,14 +1606,14 @@ musb_mode_store(struct device *dev, struct device_attribute *attr, ...@@ -1606,14 +1606,14 @@ musb_mode_store(struct device *dev, struct device_attribute *attr,
struct musb *musb = dev_to_musb(dev); struct musb *musb = dev_to_musb(dev);
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&musb->Lock, flags); spin_lock_irqsave(&musb->lock, flags);
if (!strncmp(buf, "host", 4)) if (!strncmp(buf, "host", 4))
musb_platform_set_mode(musb, MUSB_HOST); musb_platform_set_mode(musb, MUSB_HOST);
if (!strncmp(buf, "peripheral", 10)) if (!strncmp(buf, "peripheral", 10))
musb_platform_set_mode(musb, MUSB_PERIPHERAL); musb_platform_set_mode(musb, MUSB_PERIPHERAL);
if (!strncmp(buf, "otg", 3)) if (!strncmp(buf, "otg", 3))
musb_platform_set_mode(musb, MUSB_OTG); musb_platform_set_mode(musb, MUSB_OTG);
spin_unlock_irqrestore(&musb->Lock, flags); spin_unlock_irqrestore(&musb->lock, flags);
return n; return n;
} }
...@@ -1627,7 +1627,7 @@ musb_cable_show(struct device *dev, struct device_attribute *attr, char *buf) ...@@ -1627,7 +1627,7 @@ musb_cable_show(struct device *dev, struct device_attribute *attr, char *buf)
unsigned long flags; unsigned long flags;
int vbus; int vbus;
spin_lock_irqsave(&musb->Lock, flags); spin_lock_irqsave(&musb->lock, flags);
#if defined(CONFIG_USB_TUSB6010) && !defined(CONFIG_USB_MUSB_OTG) #if defined(CONFIG_USB_TUSB6010) && !defined(CONFIG_USB_MUSB_OTG)
/* REVISIT: connect-A != connect-B ... */ /* REVISIT: connect-A != connect-B ... */
vbus = musb_platform_get_vbus_status(musb); vbus = musb_platform_get_vbus_status(musb);
...@@ -1659,7 +1659,7 @@ musb_cable_show(struct device *dev, struct device_attribute *attr, char *buf) ...@@ -1659,7 +1659,7 @@ musb_cable_show(struct device *dev, struct device_attribute *attr, char *buf)
v2 = "disconnected"; v2 = "disconnected";
#endif #endif
musb_platform_try_idle(musb, 0); musb_platform_try_idle(musb, 0);
spin_unlock_irqrestore(&musb->Lock, flags); spin_unlock_irqrestore(&musb->lock, flags);
return sprintf(buf, "%s%s\n", v1, v2); return sprintf(buf, "%s%s\n", v1, v2);
} }
...@@ -1673,7 +1673,7 @@ musb_vbus_store(struct device *dev, struct device_attribute *attr, ...@@ -1673,7 +1673,7 @@ musb_vbus_store(struct device *dev, struct device_attribute *attr,
unsigned long flags; unsigned long flags;
unsigned long val; unsigned long val;
spin_lock_irqsave(&musb->Lock, flags); spin_lock_irqsave(&musb->lock, flags);
if (sscanf(buf, "%lu", &val) < 1) { if (sscanf(buf, "%lu", &val) < 1) {
printk(KERN_ERR "Invalid VBUS timeout ms value\n"); printk(KERN_ERR "Invalid VBUS timeout ms value\n");
return -EINVAL; return -EINVAL;
...@@ -1682,7 +1682,7 @@ musb_vbus_store(struct device *dev, struct device_attribute *attr, ...@@ -1682,7 +1682,7 @@ musb_vbus_store(struct device *dev, struct device_attribute *attr,
if (musb->xceiv.state == OTG_STATE_A_WAIT_BCON) if (musb->xceiv.state == OTG_STATE_A_WAIT_BCON)
musb->is_active = 0; musb->is_active = 0;
musb_platform_try_idle(musb, jiffies + msecs_to_jiffies(val)); musb_platform_try_idle(musb, jiffies + msecs_to_jiffies(val));
spin_unlock_irqrestore(&musb->Lock, flags); spin_unlock_irqrestore(&musb->lock, flags);
return n; return n;
} }
...@@ -1694,9 +1694,9 @@ musb_vbus_show(struct device *dev, struct device_attribute *attr, char *buf) ...@@ -1694,9 +1694,9 @@ musb_vbus_show(struct device *dev, struct device_attribute *attr, char *buf)
unsigned long flags; unsigned long flags;
unsigned long val; unsigned long val;
spin_lock_irqsave(&musb->Lock, flags); spin_lock_irqsave(&musb->lock, flags);
val = musb->a_wait_bcon; val = musb->a_wait_bcon;
spin_unlock_irqrestore(&musb->Lock, flags); spin_unlock_irqrestore(&musb->lock, flags);
return sprintf(buf, "%lu\n", val); return sprintf(buf, "%lu\n", val);
} }
...@@ -1716,10 +1716,10 @@ musb_srp_store(struct device *dev, struct device_attribute *attr, ...@@ -1716,10 +1716,10 @@ musb_srp_store(struct device *dev, struct device_attribute *attr,
return -EINVAL; return -EINVAL;
} }
spin_lock_irqsave(&musb->Lock, flags); spin_lock_irqsave(&musb->lock, flags);
if (srp == 1) if (srp == 1)
musb_g_wakeup(musb); musb_g_wakeup(musb);
spin_unlock_irqrestore(&musb->Lock, flags); spin_unlock_irqrestore(&musb->lock, flags);
return n; return n;
} }
...@@ -1881,7 +1881,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) ...@@ -1881,7 +1881,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
if (!musb) if (!musb)
return -ENOMEM; return -ENOMEM;
spin_lock_init(&musb->Lock); spin_lock_init(&musb->lock);
musb->board_mode = plat->mode; musb->board_mode = plat->mode;
musb->board_set_power = plat->set_power; musb->board_set_power = plat->set_power;
musb->set_clock = plat->set_clock; musb->set_clock = plat->set_clock;
...@@ -2108,7 +2108,7 @@ static int musb_suspend(struct platform_device *pdev, pm_message_t message) ...@@ -2108,7 +2108,7 @@ static int musb_suspend(struct platform_device *pdev, pm_message_t message)
if (!musb->clock) if (!musb->clock)
return 0; return 0;
spin_lock_irqsave(&musb->Lock, flags); spin_lock_irqsave(&musb->lock, flags);
if (is_peripheral_active(musb)) { if (is_peripheral_active(musb)) {
/* FIXME force disconnect unless we know USB will wake /* FIXME force disconnect unless we know USB will wake
...@@ -2124,7 +2124,7 @@ static int musb_suspend(struct platform_device *pdev, pm_message_t message) ...@@ -2124,7 +2124,7 @@ static int musb_suspend(struct platform_device *pdev, pm_message_t message)
musb->set_clock(musb->clock, 0); musb->set_clock(musb->clock, 0);
else else
clk_disable(musb->clock); clk_disable(musb->clock);
spin_unlock_irqrestore(&musb->Lock, flags); spin_unlock_irqrestore(&musb->lock, flags);
return 0; return 0;
} }
...@@ -2136,7 +2136,7 @@ static int musb_resume(struct platform_device *pdev) ...@@ -2136,7 +2136,7 @@ static int musb_resume(struct platform_device *pdev)
if (!musb->clock) if (!musb->clock)
return 0; return 0;
spin_lock_irqsave(&musb->Lock, flags); spin_lock_irqsave(&musb->lock, flags);
if (musb->set_clock) if (musb->set_clock)
musb->set_clock(musb->clock, 1); musb->set_clock(musb->clock, 1);
...@@ -2147,7 +2147,7 @@ static int musb_resume(struct platform_device *pdev) ...@@ -2147,7 +2147,7 @@ static int musb_resume(struct platform_device *pdev)
* unless for some reason the whole soc powered down and we're * unless for some reason the whole soc powered down and we're
* not treating that as a whole-system restart (e.g. swsusp) * not treating that as a whole-system restart (e.g. swsusp)
*/ */
spin_unlock_irqrestore(&musb->Lock, flags); spin_unlock_irqrestore(&musb->lock, flags);
return 0; return 0;
} }
......
...@@ -394,7 +394,7 @@ static void musb_do_idle(unsigned long _musb) ...@@ -394,7 +394,7 @@ static void musb_do_idle(unsigned long _musb)
struct musb *musb = (void *)_musb; struct musb *musb = (void *)_musb;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&musb->Lock, flags); spin_lock_irqsave(&musb->lock, flags);
switch (musb->xceiv.state) { switch (musb->xceiv.state) {
case OTG_STATE_A_WAIT_BCON: case OTG_STATE_A_WAIT_BCON:
...@@ -437,7 +437,7 @@ static void musb_do_idle(unsigned long _musb) ...@@ -437,7 +437,7 @@ static void musb_do_idle(unsigned long _musb)
tusb_allow_idle(musb, wakeups); tusb_allow_idle(musb, wakeups);
} }
done: done:
spin_unlock_irqrestore(&musb->Lock, flags); spin_unlock_irqrestore(&musb->lock, flags);
} }
/* /*
...@@ -771,7 +771,7 @@ static irqreturn_t tusb_interrupt(int irq, void *__hci) ...@@ -771,7 +771,7 @@ static irqreturn_t tusb_interrupt(int irq, void *__hci)
unsigned long flags, idle_timeout = 0; unsigned long flags, idle_timeout = 0;
u32 int_mask, int_src; u32 int_mask, int_src;
spin_lock_irqsave(&musb->Lock, flags); spin_lock_irqsave(&musb->lock, flags);
/* Mask all interrupts to allow using both edge and level GPIO irq */ /* Mask all interrupts to allow using both edge and level GPIO irq */
int_mask = musb_readl(base, TUSB_INT_MASK); int_mask = musb_readl(base, TUSB_INT_MASK);
...@@ -869,7 +869,7 @@ static irqreturn_t tusb_interrupt(int irq, void *__hci) ...@@ -869,7 +869,7 @@ static irqreturn_t tusb_interrupt(int irq, void *__hci)
musb_platform_try_idle(musb, idle_timeout); musb_platform_try_idle(musb, idle_timeout);
musb_writel(base, TUSB_INT_MASK, int_mask); musb_writel(base, TUSB_INT_MASK, int_mask);
spin_unlock_irqrestore(&musb->Lock, flags); spin_unlock_irqrestore(&musb->lock, flags);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -991,7 +991,7 @@ static int __init tusb_start(struct musb *musb) ...@@ -991,7 +991,7 @@ static int __init tusb_start(struct musb *musb)
return ret; return ret;
} }
spin_lock_irqsave(&musb->Lock, flags); spin_lock_irqsave(&musb->lock, flags);
if (musb_readl(base, TUSB_PROD_TEST_RESET) != if (musb_readl(base, TUSB_PROD_TEST_RESET) !=
TUSB_PROD_TEST_RESET_VAL) { TUSB_PROD_TEST_RESET_VAL) {
...@@ -1033,12 +1033,12 @@ static int __init tusb_start(struct musb *musb) ...@@ -1033,12 +1033,12 @@ static int __init tusb_start(struct musb *musb)
reg |= TUSB_PHY_OTG_CTRL_WRPROTECT | TUSB_PHY_OTG_CTRL_OTG_ID_PULLUP; reg |= TUSB_PHY_OTG_CTRL_WRPROTECT | TUSB_PHY_OTG_CTRL_OTG_ID_PULLUP;
musb_writel(base, TUSB_PHY_OTG_CTRL, reg); musb_writel(base, TUSB_PHY_OTG_CTRL, reg);
spin_unlock_irqrestore(&musb->Lock, flags); spin_unlock_irqrestore(&musb->lock, flags);
return 0; return 0;
err: err:
spin_unlock_irqrestore(&musb->Lock, flags); spin_unlock_irqrestore(&musb->lock, flags);
if (musb->board_set_power) if (musb->board_set_power)
musb->board_set_power(0); musb->board_set_power(0);
......
...@@ -149,7 +149,7 @@ static void tusb_omap_dma_cb(int lch, u16 ch_status, void *data) ...@@ -149,7 +149,7 @@ static void tusb_omap_dma_cb(int lch, u16 ch_status, void *data)
unsigned long remaining, flags, pio; unsigned long remaining, flags, pio;
int ch; int ch;
spin_lock_irqsave(&musb->Lock, flags); spin_lock_irqsave(&musb->lock, flags);
if (dmareq_works()) if (dmareq_works())
ch = chdat->ch; ch = chdat->ch;
...@@ -230,7 +230,7 @@ static void tusb_omap_dma_cb(int lch, u16 ch_status, void *data) ...@@ -230,7 +230,7 @@ static void tusb_omap_dma_cb(int lch, u16 ch_status, void *data)
} }
} }
spin_unlock_irqrestore(&musb->Lock, flags); spin_unlock_irqrestore(&musb->lock, flags);
} }
static int tusb_omap_dma_program(struct dma_channel *channel, u16 packet_sz, static int tusb_omap_dma_program(struct dma_channel *channel, u16 packet_sz,
......
...@@ -233,7 +233,7 @@ int musb_hub_control( ...@@ -233,7 +233,7 @@ int musb_hub_control(
* port features: reported, sometimes updated when host is active * port features: reported, sometimes updated when host is active
* no indicators * no indicators
*/ */
spin_lock_irqsave(&musb->Lock, flags); spin_lock_irqsave(&musb->lock, flags);
switch (typeReq) { switch (typeReq) {
case ClearHubFeature: case ClearHubFeature:
case SetHubFeature: case SetHubFeature:
...@@ -411,6 +411,6 @@ error: ...@@ -411,6 +411,6 @@ error:
/* "protocol stall" on error */ /* "protocol stall" on error */
retval = -EPIPE; retval = -EPIPE;
} }
spin_unlock_irqrestore(&musb->Lock, flags); spin_unlock_irqrestore(&musb->lock, flags);
return retval; return retval;
} }
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