Commit 3d9cb0ea authored by Eric Miao's avatar Eric Miao

ARM: pxa: only save/restore registers when pm functions are defined

Reported-and-tested-by: default avatarSven Neumann <s.neumann@raumfeld.com>
Signed-off-by: default avatarEric Miao <eric.y.miao@gmail.com>
parent 57834a72
...@@ -33,7 +33,7 @@ int pxa_pm_enter(suspend_state_t state) ...@@ -33,7 +33,7 @@ int pxa_pm_enter(suspend_state_t state)
#endif #endif
/* skip registers saving for standby */ /* skip registers saving for standby */
if (state != PM_SUSPEND_STANDBY) { if (state != PM_SUSPEND_STANDBY && pxa_cpu_pm_fns->save) {
pxa_cpu_pm_fns->save(sleep_save); pxa_cpu_pm_fns->save(sleep_save);
/* before sleeping, calculate and save a checksum */ /* before sleeping, calculate and save a checksum */
for (i = 0; i < pxa_cpu_pm_fns->save_count - 1; i++) for (i = 0; i < pxa_cpu_pm_fns->save_count - 1; i++)
...@@ -44,7 +44,7 @@ int pxa_pm_enter(suspend_state_t state) ...@@ -44,7 +44,7 @@ int pxa_pm_enter(suspend_state_t state)
pxa_cpu_pm_fns->enter(state); pxa_cpu_pm_fns->enter(state);
cpu_init(); cpu_init();
if (state != PM_SUSPEND_STANDBY) { if (state != PM_SUSPEND_STANDBY && pxa_cpu_pm_fns->restore) {
/* after sleeping, validate the checksum */ /* after sleeping, validate the checksum */
for (i = 0; i < pxa_cpu_pm_fns->save_count - 1; i++) for (i = 0; i < pxa_cpu_pm_fns->save_count - 1; i++)
checksum += sleep_save[i]; checksum += sleep_save[i];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment