aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/atmel_usba_udc.c
diff options
context:
space:
mode:
authorGregory CLEMENT <gregory.clement@free-electrons.com>2014-03-03 11:48:34 -0500
committerFelipe Balbi <balbi@ti.com>2014-03-05 15:40:10 -0500
commitd8eb6c653ef6b323d630de3c5685478469e248bc (patch)
tree7a1c5924fd0eb8aae913f7742093bfdaaa5732ee /drivers/usb/gadget/atmel_usba_udc.c
parentfb0e139d93f50f0cfa3ff4377d34c70dbc542797 (diff)
usb: gadget: atmel_usba: fix crashed during stopping when DEBUG is enabled
commit 511f3c5 (usb: gadget: udc-core: fix a regression during gadget driver unbinding) introduced a crash when DEBUG is enabled. The debug trace in the atmel_usba_stop function made the assumption that the driver pointer passed in parameter was not NULL, but since the commit above, such assumption was no longer always true. This commit now uses the driver pointer stored in udc which fixes this issue. [ balbi@ti.com : improved commit log a bit ] Cc: <stable@vger.kernel.org> # v3.2+ Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/atmel_usba_udc.c')
-rw-r--r--drivers/usb/gadget/atmel_usba_udc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
index e57991edcf67..9f65324f9ae0 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -1827,12 +1827,12 @@ static int atmel_usba_stop(struct usb_gadget *gadget,
1827 toggle_bias(0); 1827 toggle_bias(0);
1828 usba_writel(udc, CTRL, USBA_DISABLE_MASK); 1828 usba_writel(udc, CTRL, USBA_DISABLE_MASK);
1829 1829
1830 udc->driver = NULL;
1831
1832 clk_disable_unprepare(udc->hclk); 1830 clk_disable_unprepare(udc->hclk);
1833 clk_disable_unprepare(udc->pclk); 1831 clk_disable_unprepare(udc->pclk);
1834 1832
1835 DBG(DBG_GADGET, "unregistered driver `%s'\n", driver->driver.name); 1833 DBG(DBG_GADGET, "unregistered driver `%s'\n", udc->driver->driver.name);
1834
1835 udc->driver = NULL;
1836 1836
1837 return 0; 1837 return 0;
1838} 1838}