Skip to content

Commit dedab67

Browse files
Hongyu Xiegregkh
authored andcommitted
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]>
1 parent f097a36 commit dedab67

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/usb/cdns3/core.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -529,9 +529,7 @@ int cdns_resume(struct cdns *cdns)
529529
int ret = 0;
530530

531531
if (cdns_power_is_lost(cdns)) {
532-
if (cdns->role_sw) {
533-
cdns->role = cdns_role_get(cdns->role_sw);
534-
} else {
532+
if (!cdns->role_sw) {
535533
real_role = cdns_hw_role_state_machine(cdns);
536534
if (real_role != cdns->role) {
537535
ret = cdns_hw_role_switch(cdns);

0 commit comments

Comments
 (0)