aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/cdns3/core.c
diff options
context:
space:
mode:
authorHongyu Xie <[email protected]>2024-12-31 01:36:41 +0000
committerGreg Kroah-Hartman <[email protected]>2025-01-03 10:13:52 +0000
commitdedab674428f8a99468a4864c067128ba9ea83a6 (patch)
tree149f7788287445de672c0f413a82a4ec01129611 /drivers/usb/cdns3/core.c
parentdt-bindings: usb: qcom,dwc3: Add QCS615 to USB DWC3 bindings (diff)
downloadkernel-dedab674428f8a99468a4864c067128ba9ea83a6.tar.gz
kernel-dedab674428f8a99468a4864c067128ba9ea83a6.zip
usb: cdns3: remove redundant if branch
cdns->role_sw->dev->driver_data gets set in routines showing below, cdns_init sw_desc.driver_data = cdns; cdns->role_sw = usb_role_switch_register(dev, &sw_desc); dev_set_drvdata(&sw->dev, desc->driver_data); In cdns_resume, cdns->role = cdns_role_get(cdns->role_sw); //line redundant struct cdns *cdns = usb_role_switch_get_drvdata(sw); dev_get_drvdata(&sw->dev) return dev->driver_data return cdns->role; "line redundant" equals to, cdns->role = cdns->role; So fix this if branch. Signed-off-by: Hongyu Xie <[email protected]> Acked-by: Peter Chen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/usb/cdns3/core.c')
-rw-r--r--drivers/usb/cdns3/core.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
index 465e9267b49c..98980a23e1c2 100644
--- a/drivers/usb/cdns3/core.c
+++ b/drivers/usb/cdns3/core.c
@@ -529,9 +529,7 @@ int cdns_resume(struct cdns *cdns)
int ret = 0;
if (cdns_power_is_lost(cdns)) {
- if (cdns->role_sw) {
- cdns->role = cdns_role_get(cdns->role_sw);
- } else {
+ if (!cdns->role_sw) {
real_role = cdns_hw_role_state_machine(cdns);
if (real_role != cdns->role) {
ret = cdns_hw_role_switch(cdns);