diff --git a/drivers/power/greedy_governor.c b/drivers/power/greedy_governor.c index 152ec14624b..6f2068a17db 100644 --- a/drivers/power/greedy_governor.c +++ b/drivers/power/greedy_governor.c @@ -62,10 +62,10 @@ struct pm_greedy_governor_s /* PM governor methods */ -static void greedy_governor_statechanged(int domain, - enum pm_state_e newstate); -static enum pm_state_e greedy_governor_checkstate(int domain); -static void greedy_governor_activity(int domain, int count); +static void greedy_governor_statechanged(int domain, + enum pm_state_e newstate); +static enum pm_state_e greedy_governor_checkstate(int domain); +static void greedy_governor_activity(int domain, int count); /**************************************************************************** * Private Data @@ -73,9 +73,12 @@ static void greedy_governor_activity(int domain, int count); static const struct pm_governor_s g_greedy_governor_ops = { - .statechanged = greedy_governor_statechanged, /* statechanged */ - .checkstate = greedy_governor_checkstate, /* checkstate */ - .activity = greedy_governor_activity, /* activity */ + NULL, /* initialize */ + NULL, /* deinitialize */ + greedy_governor_statechanged, /* statechanged */ + greedy_governor_checkstate, /* checkstate */ + greedy_governor_activity, /* activity */ + NULL /* priv */ }; static struct pm_greedy_governor_s g_pm_greedy_governor; diff --git a/drivers/power/pm_activity.c b/drivers/power/pm_activity.c index ed217e585da..951a68cede2 100644 --- a/drivers/power/pm_activity.c +++ b/drivers/power/pm_activity.c @@ -81,8 +81,8 @@ static void pm_wakelock_stats(FAR struct pm_wakelock_s *wakelock, bool stay) } } #else -#define pm_wakelock_stats_rm(w) -#define pm_wakelock_stats(w, s) +# define pm_wakelock_stats_rm(w) +# define pm_wakelock_stats(w, s) #endif /**************************************************************************** @@ -193,14 +193,14 @@ void pm_relax(int domain, enum pm_state_e state) * * Description: * This function is called by a device driver to indicate that it is - * performing meaningful activities (non-idle), needs the power at kept - * last the specified level. - * And this will be timeout after time (ms), menas auto pm_relax + * performing meaningful activities (non-idle), needs the power kept at + * the last the specified level. + * And this will timeout after time (ms), menas auto pm_relax * * Input Parameters: * domain - The domain of the PM activity - * state - The state want to stay. - * ms - The timeout value ms + * state - The state want to stay. + * ms - The timeout value ms * * Returned Value: * None. diff --git a/drivers/power/pm_changestate.c b/drivers/power/pm_changestate.c index 602018e7288..e5d04374ac5 100644 --- a/drivers/power/pm_changestate.c +++ b/drivers/power/pm_changestate.c @@ -194,7 +194,7 @@ static void pm_stats(FAR struct pm_domain_s *dom, int curstate, int newstate) clock_systime_timespec(&dom->start); } #else -#define pm_stats(dom, curstate, newstate) +# define pm_stats(dom, curstate, newstate) #endif /**************************************************************************** diff --git a/drivers/power/pm_register.c b/drivers/power/pm_register.c index 897d5571343..e19240915fe 100644 --- a/drivers/power/pm_register.c +++ b/drivers/power/pm_register.c @@ -56,8 +56,6 @@ int pm_register(FAR struct pm_callback_s *callbacks) { - irqstate_t flags; - DEBUGASSERT(callbacks); /* Add the new entry to the end of the list of registered callbacks */ diff --git a/include/nuttx/power/pm.h b/include/nuttx/power/pm.h index 03a3796c95f..a263e61ae52 100644 --- a/include/nuttx/power/pm.h +++ b/include/nuttx/power/pm.h @@ -87,13 +87,11 @@ * own, custom idle loop to support board-specific IDLE time power management */ -#define PM_WAKELOCK_INITIALIZER(name, domain, state) {name, domain, state} - #define PM_WAKELOCK_DECLARE(var, name, domain, state) \ - struct pm_wakelock_s var = PM_WAKELOCK_INITIALIZER(name, domain, state) + struct pm_wakelock_s var = {name, domain, state} #define PM_WAKELOCK_DECLARE_STATIC(var, name, domain, state) \ -static struct pm_wakelock_s var = PM_WAKELOCK_INITIALIZER(name, domain, state) +static struct pm_wakelock_s var = {name, domain, state} /**************************************************************************** * Public Types @@ -801,7 +799,6 @@ void pm_auto_updatestate(int domain); * avoid so much conditional compilation in driver code when PM is disabled: */ -# define PM_WAKELOCK_INITIALIZER(n,d,s) {0} # define PM_WAKELOCK_DECLARE(v,n,d,s) # define PM_WAKELOCK_DECLARE_STATIC(v,n,d,s) # define pm_initialize()