summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/gadget.c
Commit message (Collapse)AuthorAgeFilesLines
* usb: dwc3: fix implementation of endpoint wedgeAlan Stern2013-11-251-4/+1
| | | | | | | | | | | | | | The dwc3 UDC driver doesn't implement endpoint wedging correctly. When an endpoint is wedged, the gadget driver should be allowed to clear the wedge by calling usb_ep_clear_halt(). Only the host is prevented from resetting the endpoint. This patch fixes the implementation. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Tested-by: Pratyush Anand <pratyush.anand@st.com> Cc: <stable@vger.kernel.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: gadget: avoid memory leak when failing to allocate all epsDavid Cohen2013-09-171-4/+2
| | | | | | | | If dwc3_gadget_init_endpoint() fails after allocate some of the eps, we need to free their memory to avoid leak. Signed-off-by: David Cohen <david.a.cohen@linux.intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: gadget: introduce dwc3_process_event_bufFelipe Balbi2013-07-291-37/+44
| | | | | | | | in order to make our IRQ handler thread easier to read, we re-factor the inner loop to a separate function. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: gadget: rename dwc3_process_event_bufFelipe Balbi2013-07-291-2/+2
| | | | | | | | | | | that function isn't really processing any event buffer, rather just checking whether it contains events to be processed. Due to that reason, we're reaning it to dwc3_check_event_buf() instead. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: gadget: get rid of IRQF_ONESHOTFelipe Balbi2013-07-291-1/+13
| | | | | | | | | | | | | | | We can make use of bit 31 of the GEVNTSIZ(n) registers to mask/unmask interrupts from that particular interrupter. With that feature, we can easily drop IRQF_ONESHOT from our driver which makes it possible to properly change IRQ priorities when using RT patchset *and* it allows us to make use of the scheduler to choose the proper time to handle this IRQ thread. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: gadget: don't enable LPM earlyFelipe Balbi2013-07-291-5/+0
| | | | | | | LPM is enabled in Connection Done interrupt, there's no need to enable it early. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: gadget: add a debugging print when initializing endpointsFelipe Balbi2013-07-291-0/+2
| | | | | | | | | that way we get debugging information when enabling verbose debug of the driver. It will be no-op otherwise. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: gadget: move direction setting upFelipe Balbi2013-07-291-1/+1
| | | | | | | no functional changes, just grouping dep initialization. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: gadget: move debugging print aroundFelipe Balbi2013-07-291-2/+2
| | | | | | | | | by moving that dev_vdbg() to the internal __dwc3_gadget_ep_enable() we get the print even when enable ep0, which calls the internal function directly. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: gadget: drop dwc3 manual phy controlFelipe Balbi2013-07-291-61/+0
| | | | | | | | | | | | | | | | | Recent versions of the core, can suspend and resume the PHYs automatically, so we don't need to fiddle with dwc3's Global PHY registers at all. On versions prior to 1.94a this patch will mean that we will never ask dwc3 to suspend the PHY. This is an acceptable behavior or such old versions of the core, specially considering that the only chip known to have a version prior to 1.94a was OMAP5 ES1.0 and that's not supported in mainline kernel, because it was just a test spin of OMAP5. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: make maximum-speed a per-instance attributeFelipe Balbi2013-07-291-3/+18
| | | | | | | | | | in order to allow different instances of the core work in different maximum speeds, we will move the maximum_speed module_parameter to both DeviceTree (making use the new maximum-speed DT property) and platform_data. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: switch to GPL v2 onlyFelipe Balbi2013-07-291-27/+7
| | | | | | | | | | | | | | | | This is a Linux-only driver which makes use of GPL-only symbols. It makes no sense to maintain Dual BSD/GPL licensing for this driver. Considering that the amount of work to use this driver in any different operating system would likely be as large as developing the driver from scratch and considering that we depend on GPL-only symbols, we will switch over to a GPL v2-only license. Cc: Anton Tikhomirov <av.tikhomirov@samsung.com> Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: gadget: don't request IRQs in atomicFelipe Balbi2013-07-291-17/+22
| | | | | | | | | | We cannot request an IRQ with spinlocks held as that would trigger a sleeping inside spinlock warning. Cc: <stable@vger.kernel.org> # v3.10 Reported-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: gadget: don't prevent gadget from being probed if we failFelipe Balbi2013-07-151-0/+1
| | | | | | | | | | | | | In case we fail our ->udc_start() callback, we should be ready to accept another modprobe following the failed one. We had forgotten to clear dwc->gadget_driver back to NULL and, because of that, we were preventing gadget driver modprobe from being retried. Cc: <stable@vger.kernel.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: gadget: free trb pool only from epnum 2George Cherian2013-05-281-4/+12
| | | | | | | | | | | | | | we never allocate a TRB pool for physical endpoints 0 and 1 so trying to free it (a invalid TRB pool pointer) will lead us in a warning while removing dwc3.ko module. In order to fix the situation, all we have to do is skip dwc3_free_trb_pool() for physical endpoints 0 and 1 just as we while deleting endpoints from the endpoints list. Cc: stable@vger.kernel.org Signed-off-by: George Cherian <george.cherian@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: gadget: use num_(in|out)_eps from HW paramsFelipe Balbi2013-03-181-4/+35
| | | | | | | that way we will only tell gadget framework about the endpoints we actually have. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: workaround: unexpected transtion U3 -> RESUMEFelipe Balbi2013-03-181-0/+28
| | | | | | | | | | | | | In DWC3 versions < 2.50a configured without Hibernation mode enabled, there will be an extra link status change interrupt if device detects host-initiated U3 exit. In that case, core will generate an unnecessary U3 -> RESUME transition which should be ignored by the driver. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: gadget: don't assign gadget.dev.release directlyFelipe Balbi2013-03-181-6/+1
| | | | | | | udc-core provides a better way to handle release methods, let's use it. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: gadget: don't touch gadget.dev.driverFelipe Balbi2013-03-181-2/+0
| | | | | | | udc-core now handles that for us, which means we can remove it from our driver. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: gadget: remove unnecessary initializationsFelipe Balbi2013-03-181-6/+0
| | | | | | | udc-core now sets dma-related and parent fields for us, we don't need to do it ourselves. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: gadget: implement gadget state trackingFelipe Balbi2013-03-181-1/+1
| | | | | | | make use of the previously introduced gadget->state field. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: gadget: move to threaded IRQFelipe Balbi2013-03-181-26/+60
| | | | | | | | | | | by moving to threaded IRQs, we allow our IRQ priorities to be configurable when running with realtime patch. Also, since we're running in thread context, we can call functions which might sleep, such as sysfs_notify() without problems. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: core: add power management supportFelipe Balbi2013-03-181-0/+61
| | | | | | | | | | | | | Add support for basic power management on the dwc3 driver. While there is still lots to improve for full PM support, this minimal patch will already make sure that we survive suspend-to-ram and suspend-to-disk without major issues. Cc: Vikas C Sajjan <vikas.sajjan@linaro.org> Tested-by: Vivek Gautam <gautam.vivek@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: gadget: save state of pullupsFelipe Balbi2013-03-181-0/+2
| | | | | | | | This will be used during resume to verify if we should reconnect our pullups or not. Tested-by: Vivek Gautam <gautam.vivek@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: gadget: introduce and use enable/disable irq methodsFelipe Balbi2013-03-181-35/+45
| | | | | | | | | | | | | we don't need to enable IRQs until we have a gadget driver loaded and ready to work, so let's delay IRQ enable to ->udc_start() and IRQ disable to ->udc_stop(). While at that, also move the related use of request_irq() and free_irq(). Tested-by: Vivek Gautam <gautam.vivek@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: drop now unnecessary flagFelipe Balbi2013-03-181-1/+0
| | | | | | | | | | We don't need the ->register_my_device flag anymore because all UDC drivers have been properly converted. Let's remove every history of it. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: gadget: let udc-core manage gadget->devFelipe Balbi2013-03-181-15/+2
| | | | | | | We don't need to register that device ourselves if we simply set gadget->register_my_device. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: dwc3: gadget: remove unnecessary codeFelipe Balbi2013-03-041-3/+0
| | | | | | | | | the params variables on dwc3_gadget_conndone_interrupt() is only memset() to zero but never used in that function, so we can safely drop the variable and memset() call. Signed-off-by: Felipe Balbi <balbi@ti.com>
* Merge 3.8-rc5 into usb-nextGreg Kroah-Hartman2013-01-251-0/+1
|\ | | | | | | | | | | | | This fixes up a conflict with drivers/usb/serial/io_ti.c that came up in linux-next. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * usb: dwc3: gadget: fix ep->maxburst for ep0Pratyush Anand2013-01-181-0/+1
| | | | | | | | | | | | | | | | | | dwc3_gadget_set_ep_config expects maxburst as incremented by 1. So, by default initialize ep->maxburst to 1 for ep0. Cc: <stable@vger.kernel.org> Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: gadget: change HIRD threshold to 12Felipe Balbi2013-01-241-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First of all, that 28 value makes no sense as HIRD threshold is a 4-bit value, second of all it's causing issues for OMAP5. Using 12 because commit cbc725b3 (usb: dwc3: keep default hird threshold value as 4b1100) had the intention of setting the maximum allowed value of 0xc. Also, original code has been wrong forever, so this should be backported as far back as possible. Cc: <stable@vger.kernel.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: gadget: req->queued must be forced to false in cleanupPratyush Anand2013-01-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | I am not sure, why I found it during SG debugging. But, I noticed that even when req_queued list was empty, there were some request in request_list having queued flag true. If I run test second time, it first removes all request from request_list and hence busy_slot was wrongly incremented. Cc: <stable@vger.kernel.org> Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: gadget: fix scatter gather implementationPratyush Anand2013-01-181-92/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To work with scatter gather properly, fixes have been done in number of functions. I will explain requirement of each fixes one by one. start_slot: used to retrieve all request of SG during cleanup dwc3_gadget_giveback: We need to skip link TRB if it was one of the intermediate TRB of SG. dwc3_prepare_one_trb: We need to track all submitted TRBs during cleanup. Since, all TRBs would be serially allocated, so we can just keep starting slot info and we can always find rest of them. We need to pass sg node number, so that we cab appropriately program ISOC_FIRST/ISOC, Chain etc. dwc3_prepare_trbs: last_one should be set when it is last node of SG as well as last node of request_list. __dwc3_cleanup_done_trbs: It has been prepared after re-factorization of dwc3_cleanup_done_reqs. It is called for each TRB of SG. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: gadget: no need to pass params in case of UPDATE_TRANSFERPratyush Anand2013-01-181-4/+5
| | | | | | | | | | | | | | UPDATE_TRANSFER does not need any parameters. So, no need to prepare it. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: gadget: fix skip LINK_TRB on ISOCPratyush Anand2013-01-181-8/+5
| | | | | | | | | | | | | | | | | | | | When we reach to link trb, we just need to increase free_slot and then calculate TRB. Return is not correct, as it will cause wrong TRB DMA address to fetch in case of update transfer. Cc: <stable@vger.kernel.org> Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: gadget: fix isoc END TRANSFER ConditionPratyush Anand2013-01-181-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were still some corner cases where isoc transfer was not able to restart, specially when missed isoc does not happen , and in fact gadget does not queue any new request during giveback. Cleanup function calls giveback first, which provides a way to queue another request to gadget. But gadget did not had any data. So , it did not call ep_queue. To twist it further, gadget did not queue till cleanup for last queued TRB is called. If we ever reach this scenario, we must call END TRANSFER, so that we receive a new xfernotready with information about current microframe number. Also insure that there is no request submitted to core when issuing END TRANSFER. Cc: <stable@vger.kernel.org> # v3.8 Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: gadget: correct return from ep_queuePratyush Anand2013-01-181-0/+2
| | | | | | | | | | | | | | | | Its better to return from each if condition as they are mutually exclusive. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: gadget: fix missed isocPratyush Anand2013-01-181-12/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two reasons to generate missed isoc. 1. when the host does not poll for all the data. 2. because of application-side delays that prevent all the data from being transferred in programmed microframe. Current code was able to handle first case only. This patch handles scenario 2 as well.Scenario 2 sometime may occur with complex gadget application, however it can be easily reproduced for testing purpose as follows: a. use isoc binterval as 1 in f_sourcesink. b. use pattern=0 c. introduce a delay of 150us deliberately in source_sink_complete, so that after few frames it lands into scenario 2. d. now run testusb 16 (isoc in test). You will notice that if this patch is not applied then isoc transfer is not able to recover after first missed. Current patch's approach is as under: If missed isoc occurs and there is no request queued then issue END TRANSFER, so that core generates next xfernotready and we will issue a fresh START TRANSFER. If there are still queued request then wait, do not issue either END or UPDATE TRANSFER, just attach next request in request_list during giveback. If any future queued request is successfully transferred then we will issue UPDATE TRANSFER for all request in the request_list. Cc: <stable@vger.kernel.org> # v3.6 v3.7 v3.8 Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: Enable usb2 LPM only when connected as usb2.0Pratyush Anand2013-01-181-13/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | Synopsys says: The HIRD Threshold field must be set to ‘0’ when the device core is operating in super speed mode. This patch implements above statement. Cc: <stable@vger.kernel.org> # v3.6 v3.7 v3.8 Acked-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: gadget: don't redefine 'ret'Felipe Balbi2013-01-181-2/+0
|/ | | | | | | we have an extra 'ret' variable shadowing a previous definition. Remove it. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: remove use of __devinitBill Pemberton2012-11-211-2/+2
| | | | | | | | | | | | | | | | | | | | CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Peter Korsgaard <jacmet@sunsite.dk> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Acked-by: Felipe Balbi <balbi@ti.com> Cc: Li Yang <leoli@freescale.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Cc: Geoff Levand <geoff@infradead.org> Cc: Wan ZongShun <mcuos.com@gmail.com> Cc: Olav Kongas <ok@artecdesign.ee> Cc: Lennert Buytenhek <kernel@wantstofly.org> Cc: Ben Dooks <ben-linux@fluff.org> Cc: Kukjin Kim <kgene.kim@samsung.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: dwc3: gadget: fix 'endpoint always busy' bugFelipe Balbi2012-10-151-1/+1
| | | | | | | | | | | | | | | | | | | If a USB transfer has already been started, meaning we have already issued StartTransfer command to that particular endpoint, DWC3_EP_BUSY flag has also already been set. When we try to cancel this transfer which is already in controller's cache, we will not receive XferComplete event and we must clear DWC3_EP_BUSY in order to allow subsequent requests to be properly started. The best place to clear that flag is right after issuing DWC3_DEPCMD_ENDTRANSFER. Cc: stable@vger.kernel.org # v3.4 v3.5 v3.6 Reported-by: Moiz Sonasath <m-sonasath@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* Merge 3.6-rc6 into usb-nextGreg Kroah-Hartman2012-09-161-2/+19
|\ | | | | | | | | | | | | | | | | This resolves the merge problems with: drivers/usb/dwc3/gadget.c drivers/usb/musb/tusb6010.c that had been seen in linux-next. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * usb: dwc3: gadget: fix pending isoc handlingPratyush Anand2012-09-061-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | If xfernotready is received and there is no request in request_list then REQUEST_PENDING flag must be set, so that next request in ep queue is executed. In case of isoc transfer, if xfernotready is already elapsed and even first request has not been queued to request_list, then issue END TRANSFER, so that you can receive xfernotready again and can have notion of current microframe. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * usb: dwc3: ep0: correct cache sync issue in case of ep0_bouncedPratyush Anand2012-09-061-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In case of ep0 out, if length is not aligned to maxpacket size then we use dwc->ep_bounce_addr for dma transfer and not request->dma. Since, we have alreday done memcpy from dwc->ep0_bounce to request->buf, so we do not need to issue cache sync function. In fact, cache sync function will bring wrong data in request->buf from request->dma in this scenario. So, cache sync function must not be executed in case of ep0 bounced. Cc: <stable@vger.kernel.org> # v3.4 v3.5 Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: set up burst size only superspeed modeChanho Park2012-08-311-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When connection is established non-ss mode, endpoint.maxburst is correctly set to 0, this means that current code will set maxburst bitfield on DEPCFG's parameter 0 to the highest possible value (0x0f) which is wrong. Even though this hasn't caused any issues so far (HW seems to ignore that when not running in SS mode) we want to make sure maxburst bitfield is only set to anything other than zero if we're running on SuperSpeed mode. In order to achieve that, let's check for gadget's operating speed before setting maxburst bitfield when issuing DEPCFG command. [ balbi@ti.com : improved commit log a bit in order to clarify the situation ] Signed-off-by: Chanho Park <chanho61.park@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: gadget: warn about endpoint already enabled before changing ep nameFelipe Balbi2012-08-151-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case some gadget driver tries to enable an endpoint which is already enabled, we print a nice WARN so we can track broken gadget drivers. The only problem is that we're printing the WARN when we already changed endpoint's name, which would result in endpoints named as: ep1in-bulk-bulk-bulk-bulk-bulk-bulk-bulk To prevent that, we will continue to print the WARN, but do so before changing endpoint's name and return early. Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: gadget: Fix dwc3_stop_active_transfer for synchronization delayPratyush Anand2012-08-091-21/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | dwc3_stop_active_transfer has been called from two places. After each calling of this function , we should allow 100 us delay to synchronize with interconnect. It would be better if we put this delay in that function only, rather than into calling routine of this function. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Reported-by: Michel Sanches <michel.sanches@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: gadget: correct missed isoc when endpoint is busyPratyush Anand2012-08-071-1/+2
| | | | | | | | | | | | | | | | | | When MISSED_ISOC is set, BUSY is also set. Since, we are handling MISSED_ISOC as a separate case in third scenario, therefore handle only BUSY but not MISSED_ISOC in second scenario. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* | usb: dwc3: gadget: Fix sparse warningsMoiz Sonasath2012-08-071-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the following sparse warnings: drivers/usb/dwc3/gadget.c:1096:7: warning: symbol 'ret' shadows an earlier one drivers/usb/dwc3/gadget.c:1058:8: originally declared here drivers/usb/dwc3/gadget.c:1100:16: warning: symbol 'dwc' shadows an earlier one drivers/usb/dwc3/gadget.c:1057:15: originally declared here drivers/usb/dwc3/gadget.c:1118:16: warning: symbol 'dwc' shadows an earlier one drivers/usb/dwc3/gadget.c:1057:15: originally declared here drivers/usb/dwc3/gadget.c:1800:19: warning: symbol 'dep' shadows an earlier one drivers/usb/dwc3/gadget.c:1778:18: originally declared here Also, fix the potential checkpatch errors around the if() loops that this fix patch can create. Signed-off-by: Moiz Sonasath <m-sonasath@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>