Skip to content

Commit 23d5855

Browse files
committed
PM / s2idle: Rename platform operations structure
Rename struct platform_freeze_ops to platform_s2idle_ops to make it clear that the callbacks in it are used during suspend-to-idle suspend/resume transitions and rename the related functions, variables and so on accordingly. Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 28ba086 commit 23d5855

File tree

3 files changed

+32
-32
lines changed

3 files changed

+32
-32
lines changed

drivers/acpi/sleep.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -737,14 +737,14 @@ static struct acpi_scan_handler lps0_handler = {
737737
.attach = lps0_device_attach,
738738
};
739739

740-
static int acpi_freeze_begin(void)
740+
static int acpi_s2idle_begin(void)
741741
{
742742
acpi_scan_lock_acquire();
743743
s2idle_in_progress = true;
744744
return 0;
745745
}
746746

747-
static int acpi_freeze_prepare(void)
747+
static int acpi_s2idle_prepare(void)
748748
{
749749
if (lps0_device_handle) {
750750
acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_OFF);
@@ -764,7 +764,7 @@ static int acpi_freeze_prepare(void)
764764
return 0;
765765
}
766766

767-
static void acpi_freeze_wake(void)
767+
static void acpi_s2idle_wake(void)
768768
{
769769
/*
770770
* If IRQD_WAKEUP_ARMED is not set for the SCI at this point, it means
@@ -778,7 +778,7 @@ static void acpi_freeze_wake(void)
778778
}
779779
}
780780

781-
static void acpi_freeze_sync(void)
781+
static void acpi_s2idle_sync(void)
782782
{
783783
/*
784784
* Process all pending events in case there are any wakeup ones.
@@ -791,7 +791,7 @@ static void acpi_freeze_sync(void)
791791
s2idle_wakeup = false;
792792
}
793793

794-
static void acpi_freeze_restore(void)
794+
static void acpi_s2idle_restore(void)
795795
{
796796
if (acpi_sci_irq_valid())
797797
disable_irq_wake(acpi_sci_irq);
@@ -804,19 +804,19 @@ static void acpi_freeze_restore(void)
804804
}
805805
}
806806

807-
static void acpi_freeze_end(void)
807+
static void acpi_s2idle_end(void)
808808
{
809809
s2idle_in_progress = false;
810810
acpi_scan_lock_release();
811811
}
812812

813-
static const struct platform_freeze_ops acpi_freeze_ops = {
814-
.begin = acpi_freeze_begin,
815-
.prepare = acpi_freeze_prepare,
816-
.wake = acpi_freeze_wake,
817-
.sync = acpi_freeze_sync,
818-
.restore = acpi_freeze_restore,
819-
.end = acpi_freeze_end,
813+
static const struct platform_s2idle_ops acpi_s2idle_ops = {
814+
.begin = acpi_s2idle_begin,
815+
.prepare = acpi_s2idle_prepare,
816+
.wake = acpi_s2idle_wake,
817+
.sync = acpi_s2idle_sync,
818+
.restore = acpi_s2idle_restore,
819+
.end = acpi_s2idle_end,
820820
};
821821

822822
static void acpi_sleep_suspend_setup(void)
@@ -831,7 +831,7 @@ static void acpi_sleep_suspend_setup(void)
831831
&acpi_suspend_ops_old : &acpi_suspend_ops);
832832

833833
acpi_scan_add_handler(&lps0_handler);
834-
freeze_set_ops(&acpi_freeze_ops);
834+
s2idle_set_ops(&acpi_s2idle_ops);
835835
}
836836

837837
#else /* !CONFIG_SUSPEND */

include/linux/suspend.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ struct platform_suspend_ops {
186186
void (*recover)(void);
187187
};
188188

189-
struct platform_freeze_ops {
189+
struct platform_s2idle_ops {
190190
int (*begin)(void);
191191
int (*prepare)(void);
192192
void (*wake)(void);
@@ -251,7 +251,7 @@ static inline bool idle_should_enter_s2idle(void)
251251
}
252252

253253
extern void __init pm_states_init(void);
254-
extern void freeze_set_ops(const struct platform_freeze_ops *ops);
254+
extern void s2idle_set_ops(const struct platform_s2idle_ops *ops);
255255
extern void s2idle_wake(void);
256256

257257
/**
@@ -286,7 +286,7 @@ static inline void suspend_set_ops(const struct platform_suspend_ops *ops) {}
286286
static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; }
287287
static inline bool idle_should_enter_s2idle(void) { return false; }
288288
static inline void __init pm_states_init(void) {}
289-
static inline void freeze_set_ops(const struct platform_freeze_ops *ops) {}
289+
static inline void s2idle_set_ops(const struct platform_s2idle_ops *ops) {}
290290
static inline void s2idle_wake(void) {}
291291
#endif /* !CONFIG_SUSPEND */
292292

kernel/power/suspend.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,16 @@ unsigned int pm_suspend_global_flags;
5656
EXPORT_SYMBOL_GPL(pm_suspend_global_flags);
5757

5858
static const struct platform_suspend_ops *suspend_ops;
59-
static const struct platform_freeze_ops *freeze_ops;
59+
static const struct platform_s2idle_ops *s2idle_ops;
6060
static DECLARE_WAIT_QUEUE_HEAD(s2idle_wait_head);
6161

6262
enum s2idle_states __read_mostly s2idle_state;
6363
static DEFINE_SPINLOCK(s2idle_lock);
6464

65-
void freeze_set_ops(const struct platform_freeze_ops *ops)
65+
void s2idle_set_ops(const struct platform_s2idle_ops *ops)
6666
{
6767
lock_system_sleep();
68-
freeze_ops = ops;
68+
s2idle_ops = ops;
6969
unlock_system_sleep();
7070
}
7171

@@ -131,13 +131,13 @@ static void s2idle_loop(void)
131131
break;
132132
}
133133

134-
if (freeze_ops && freeze_ops->wake)
135-
freeze_ops->wake();
134+
if (s2idle_ops && s2idle_ops->wake)
135+
s2idle_ops->wake();
136136

137137
dpm_noirq_end();
138138

139-
if (freeze_ops && freeze_ops->sync)
140-
freeze_ops->sync();
139+
if (s2idle_ops && s2idle_ops->sync)
140+
s2idle_ops->sync();
141141

142142
if (pm_wakeup_pending())
143143
break;
@@ -250,8 +250,8 @@ static int platform_suspend_prepare(suspend_state_t state)
250250

251251
static int platform_suspend_prepare_late(suspend_state_t state)
252252
{
253-
return state == PM_SUSPEND_TO_IDLE && freeze_ops && freeze_ops->prepare ?
254-
freeze_ops->prepare() : 0;
253+
return state == PM_SUSPEND_TO_IDLE && s2idle_ops && s2idle_ops->prepare ?
254+
s2idle_ops->prepare() : 0;
255255
}
256256

257257
static int platform_suspend_prepare_noirq(suspend_state_t state)
@@ -268,8 +268,8 @@ static void platform_resume_noirq(suspend_state_t state)
268268

269269
static void platform_resume_early(suspend_state_t state)
270270
{
271-
if (state == PM_SUSPEND_TO_IDLE && freeze_ops && freeze_ops->restore)
272-
freeze_ops->restore();
271+
if (state == PM_SUSPEND_TO_IDLE && s2idle_ops && s2idle_ops->restore)
272+
s2idle_ops->restore();
273273
}
274274

275275
static void platform_resume_finish(suspend_state_t state)
@@ -280,8 +280,8 @@ static void platform_resume_finish(suspend_state_t state)
280280

281281
static int platform_suspend_begin(suspend_state_t state)
282282
{
283-
if (state == PM_SUSPEND_TO_IDLE && freeze_ops && freeze_ops->begin)
284-
return freeze_ops->begin();
283+
if (state == PM_SUSPEND_TO_IDLE && s2idle_ops && s2idle_ops->begin)
284+
return s2idle_ops->begin();
285285
else if (suspend_ops && suspend_ops->begin)
286286
return suspend_ops->begin(state);
287287
else
@@ -290,8 +290,8 @@ static int platform_suspend_begin(suspend_state_t state)
290290

291291
static void platform_resume_end(suspend_state_t state)
292292
{
293-
if (state == PM_SUSPEND_TO_IDLE && freeze_ops && freeze_ops->end)
294-
freeze_ops->end();
293+
if (state == PM_SUSPEND_TO_IDLE && s2idle_ops && s2idle_ops->end)
294+
s2idle_ops->end();
295295
else if (suspend_ops && suspend_ops->end)
296296
suspend_ops->end();
297297
}

0 commit comments

Comments
 (0)