From: Peter Chen Date: Tue, 1 Sep 2020 02:33:48 +0000 (+0800) Subject: usb: cdns3: core: quit if it uses role switch class X-Git-Tag: io_uring-5.10-2020-10-20~50^2~12^2~65 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=50642709f6590fe40afa6d22c32f23f5b842aed5;p=linux-2.6-block.git usb: cdns3: core: quit if it uses role switch class If the board uses role switch class for switching the role, it should not depends on SoC OTG hardware siginal any more, so quit early. Signed-off-by: Peter Chen Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c index 4c1445cf2ad0..a0f73d4711ae 100644 --- a/drivers/usb/cdns3/core.c +++ b/drivers/usb/cdns3/core.c @@ -280,6 +280,10 @@ int cdns3_hw_role_switch(struct cdns3 *cdns) enum usb_role real_role, current_role; int ret = 0; + /* Depends on role switch class */ + if (cdns->role_sw) + return 0; + pm_runtime_get_sync(cdns->dev); current_role = cdns->role;