]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: dwc2/gadget: fix phy disable sequence
authorKamil Debski <k.debski@samsung.com>
Tue, 9 Sep 2014 08:44:08 +0000 (10:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 5 Oct 2014 20:40:59 +0000 (13:40 -0700)
commit2290f23673bd5d0863acfdb52665c5f29681ec0b
tree63cbaedfd47a0e2f0075cea0063306eee3928f8b
parentc2b8d9051994463343f8e2ec374f4d5161957436
usb: dwc2/gadget: fix phy disable sequence

commit 0655314be0d9c54ad5f63500219485c6a9d9e5e2 upstream.

When the driver is removed s3c_hsotg_phy_disable is called three times
instead of once. This results in decreasing of the phy reference counter
below zero and thus consecutive inserts of the module fails.

This patch removes calls to s3c_hsotg_phy_disable from s3c_hsotg_remove
and s3c_hsotg_udc_stop.

s3c_hsotg_udc_stop is called from udc-core.c only after
usb_gadget_disconnect, which in turn calls s3c_hsotg_pullup, which
already calls s3c_hsotg_phy_disable.

s3c_hsotg_remove must be called only after udc_stop, so there is no
point in disabling phy once again there.

Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc2/gadget.c