usb: chipidea: udc: fix error path in udc_start()

This patch fixes the error path of udc_start(). Now NULL is used to
unset the peripheral with otg_set_peripheral().

Cc: stable <stable@vger.kernel.org>
Reviewed-by: Richard Zhao <richard.zhao@freescale.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Marc Kleine-Budde 2012-09-12 14:58:02 +03:00 committed by Greg Kroah-Hartman
parent c0a48e6c75
commit c9d1f947a8

View file

@ -1748,7 +1748,7 @@ static int udc_start(struct ci13xxx *ci)
remove_trans: remove_trans:
if (!IS_ERR_OR_NULL(ci->transceiver)) { if (!IS_ERR_OR_NULL(ci->transceiver)) {
otg_set_peripheral(ci->transceiver->otg, &ci->gadget); otg_set_peripheral(ci->transceiver->otg, NULL);
if (ci->global_phy) if (ci->global_phy)
usb_put_phy(ci->transceiver); usb_put_phy(ci->transceiver);
} }