usb: cdns3: drd: simplify *switch_gadet and *switch_host
Patch split function cdns3_drd_switch_gadget and cdns3_drd_switch_host into: - cdns3_drd_host_on - cdns3_drd_host_off - cdns3_drd_gadget_on - cdns3_drd_gadgett_off These functions don't have any shared code so it's better to have smaller, faster and easier functions. Signed-off-by: Pawel Laszczak <pawell@cadence.com> Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Felipe Balbi <balbi@kernel.org>
This commit is contained in:

committed by
Felipe Balbi

parent
f41ca26b8b
commit
b2aeb6da3d
@@ -3017,7 +3017,7 @@ void cdns3_gadget_exit(struct cdns3 *cdns)
|
||||
kfree(priv_dev->zlp_buf);
|
||||
kfree(priv_dev);
|
||||
cdns->gadget_dev = NULL;
|
||||
cdns3_drd_switch_gadget(cdns, 0);
|
||||
cdns3_drd_gadget_off(cdns);
|
||||
}
|
||||
|
||||
static int cdns3_gadget_start(struct cdns3 *cdns)
|
||||
@@ -3148,7 +3148,7 @@ static int __cdns3_gadget_init(struct cdns3 *cdns)
|
||||
return ret;
|
||||
}
|
||||
|
||||
cdns3_drd_switch_gadget(cdns, 1);
|
||||
cdns3_drd_gadget_on(cdns);
|
||||
pm_runtime_get_sync(cdns->dev);
|
||||
|
||||
ret = cdns3_gadget_start(cdns);
|
||||
|
Reference in New Issue
Block a user