Skip to content

Commit 0bde749

Browse files
tlebgregkh
authored andcommitted
usb: cdns3: rename hibernated argument of role->resume() to lost_power
The cdns_role_driver->resume() callback takes a second boolean argument named `hibernated` in its implementations. This is mistaken; the only potential caller is: int cdns_resume(struct cdns *cdns) { /* ... */ if (cdns->roles[cdns->role]->resume) cdns->roles[cdns->role]->resume(cdns, cdns_power_is_lost(cdns)); return 0; } The argument can be true in cases outside of return from hibernation. Reflect the true meaning by renaming both arguments to `lost_power`. Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com> Acked-by: Peter Chen <peter.chen@kernel.org> Link: https://lore.kernel.org/r/20250205-s2r-cdns-v7-3-13658a271c3c@bootlin.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 7aad3a4 commit 0bde749

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

drivers/usb/cdns3/cdns3-gadget.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3468,15 +3468,15 @@ __must_hold(&cdns->lock)
34683468
return 0;
34693469
}
34703470

3471-
static int cdns3_gadget_resume(struct cdns *cdns, bool hibernated)
3471+
static int cdns3_gadget_resume(struct cdns *cdns, bool lost_power)
34723472
{
34733473
struct cdns3_device *priv_dev = cdns->gadget_dev;
34743474

34753475
if (!priv_dev->gadget_driver)
34763476
return 0;
34773477

34783478
cdns3_gadget_config(priv_dev);
3479-
if (hibernated)
3479+
if (lost_power)
34803480
writel(USB_CONF_DEVEN, &priv_dev->regs->usb_conf);
34813481

34823482
return 0;

drivers/usb/cdns3/cdnsp-gadget.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1974,7 +1974,7 @@ static int cdnsp_gadget_suspend(struct cdns *cdns, bool do_wakeup)
19741974
return 0;
19751975
}
19761976

1977-
static int cdnsp_gadget_resume(struct cdns *cdns, bool hibernated)
1977+
static int cdnsp_gadget_resume(struct cdns *cdns, bool lost_power)
19781978
{
19791979
struct cdnsp_device *pdev = cdns->gadget_dev;
19801980
enum usb_device_speed max_speed;

drivers/usb/cdns3/core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct cdns_role_driver {
3030
int (*start)(struct cdns *cdns);
3131
void (*stop)(struct cdns *cdns);
3232
int (*suspend)(struct cdns *cdns, bool do_wakeup);
33-
int (*resume)(struct cdns *cdns, bool hibernated);
33+
int (*resume)(struct cdns *cdns, bool lost_power);
3434
const char *name;
3535
#define CDNS_ROLE_STATE_INACTIVE 0
3636
#define CDNS_ROLE_STATE_ACTIVE 1

0 commit comments

Comments
 (0)