diff options
| author | Théo Lebrun <[email protected]> | 2025-02-05 17:36:49 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2025-03-14 08:18:02 +0000 |
| commit | 17c6526b333cfd89a4c888a6f7c876c8c326e5ae (patch) | |
| tree | 2f4fa14926327c3998f78221c2461e9d02c0aa67 /drivers/usb/cdns3/core.c | |
| parent | usb: cdns3: rename hibernated argument of role->resume() to lost_power (diff) | |
| download | kernel-17c6526b333cfd89a4c888a6f7c876c8c326e5ae.tar.gz kernel-17c6526b333cfd89a4c888a6f7c876c8c326e5ae.zip | |
usb: cdns3: call cdns_power_is_lost() only once in cdns_resume()
cdns_power_is_lost() does a register read.
Call it only once rather than twice.
Signed-off-by: Théo Lebrun <[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.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c index 98980a23e1c2..1243a5cea91b 100644 --- a/drivers/usb/cdns3/core.c +++ b/drivers/usb/cdns3/core.c @@ -524,11 +524,12 @@ EXPORT_SYMBOL_GPL(cdns_suspend); int cdns_resume(struct cdns *cdns) { + bool power_lost = cdns_power_is_lost(cdns); enum usb_role real_role; bool role_changed = false; int ret = 0; - if (cdns_power_is_lost(cdns)) { + if (power_lost) { if (!cdns->role_sw) { real_role = cdns_hw_role_state_machine(cdns); if (real_role != cdns->role) { @@ -551,7 +552,7 @@ int cdns_resume(struct cdns *cdns) } if (cdns->roles[cdns->role]->resume) - cdns->roles[cdns->role]->resume(cdns, cdns_power_is_lost(cdns)); + cdns->roles[cdns->role]->resume(cdns, power_lost); return 0; } |
