diff options
| author | Rafael J. Wysocki <rjw@sisk.pl> | 2011-05-24 17:36:06 -0400 |
|---|---|---|
| committer | Rafael J. Wysocki <rjw@sisk.pl> | 2011-05-24 17:36:06 -0400 |
| commit | f42a9813fbf930fea3bdd0524dcb43c7feb0c977 (patch) | |
| tree | 9396a7cf0b18ff2ce04cbe4698466ad6196afc75 /kernel | |
| parent | 354258011e8e86961f7a72ad154ca8caf0c4c6f7 (diff) | |
PM / Hibernate: Update kerneldoc comments in hibernate.c
Some of the kerneldoc comments in kernel/power/hibernate.c are
outdated and some of them don't adhere to the kernel's standards.
Update them and make them look in a consistent way.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/power/hibernate.c | 194 |
1 files changed, 104 insertions, 90 deletions
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index 16aa3bcd6b54..8f7b1db1ece1 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c | |||
| @@ -54,10 +54,9 @@ static int hibernation_mode = HIBERNATION_SHUTDOWN; | |||
| 54 | static const struct platform_hibernation_ops *hibernation_ops; | 54 | static const struct platform_hibernation_ops *hibernation_ops; |
| 55 | 55 | ||
| 56 | /** | 56 | /** |
| 57 | * hibernation_set_ops - set the global hibernate operations | 57 | * hibernation_set_ops - Set the global hibernate operations. |
| 58 | * @ops: the hibernation operations to use in subsequent hibernation transitions | 58 | * @ops: Hibernation operations to use in subsequent hibernation transitions. |
| 59 | */ | 59 | */ |
| 60 | |||
| 61 | void hibernation_set_ops(const struct platform_hibernation_ops *ops) | 60 | void hibernation_set_ops(const struct platform_hibernation_ops *ops) |
| 62 | { | 61 | { |
| 63 | if (ops && !(ops->begin && ops->end && ops->pre_snapshot | 62 | if (ops && !(ops->begin && ops->end && ops->pre_snapshot |
| @@ -114,10 +113,9 @@ static int hibernation_test(int level) { return 0; } | |||
| 114 | #endif /* !CONFIG_PM_DEBUG */ | 113 | #endif /* !CONFIG_PM_DEBUG */ |
| 115 | 114 | ||
| 116 | /** | 115 | /** |
| 117 | * platform_begin - tell the platform driver that we're starting | 116 | * platform_begin - Call platform to start hibernation. |
| 118 | * hibernation | 117 | * @platform_mode: Whether or not to use the platform driver. |
| 119 | */ | 118 | */ |
| 120 | |||
| 121 | static int platform_begin(int platform_mode) | 119 | static int platform_begin(int platform_mode) |
| 122 | { | 120 | { |
| 123 | return (platform_mode && hibernation_ops) ? | 121 | return (platform_mode && hibernation_ops) ? |
| @@ -125,10 +123,9 @@ static int platform_begin(int platform_mode) | |||
| 125 | } | 123 | } |
| 126 | 124 | ||
| 127 | /** | 125 | /** |
| 128 | * platform_end - tell the platform driver that we've entered the | 126 | * platform_end - Call platform to finish transition to the working state. |
| 129 | * working state | 127 | * @platform_mode: Whether or not to use the platform driver. |
| 130 | */ | 128 | */ |
| 131 | |||
| 132 | static void platform_end(int platform_mode) | 129 | static void platform_end(int platform_mode) |
| 133 | { | 130 | { |
| 134 | if (platform_mode && hibernation_ops) | 131 | if (platform_mode && hibernation_ops) |
| @@ -136,8 +133,11 @@ static void platform_end(int platform_mode) | |||
| 136 | } | 133 | } |
| 137 | 134 | ||
| 138 | /** | 135 | /** |
| 139 | * platform_pre_snapshot - prepare the machine for hibernation using the | 136 | * platform_pre_snapshot - Call platform to prepare the machine for hibernation. |
| 140 | * platform driver if so configured and return an error code if it fails | 137 | * @platform_mode: Whether or not to use the platform driver. |
| 138 | * | ||
| 139 | * Use the platform driver to prepare the system for creating a hibernate image, | ||
| 140 | * if so configured, and return an error code if that fails. | ||
| 141 | */ | 141 | */ |
| 142 | 142 | ||
| 143 | static int platform_pre_snapshot(int platform_mode) | 143 | static int platform_pre_snapshot(int platform_mode) |
| @@ -147,10 +147,14 @@ static int platform_pre_snapshot(int platform_mode) | |||
| 147 | } | 147 | } |
| 148 | 148 | ||
| 149 | /** | 149 | /** |
| 150 | * platform_leave - prepare the machine for switching to the normal mode | 150 | * platform_leave - Call platform to prepare a transition to the working state. |
| 151 | * of operation using the platform driver (called with interrupts disabled) | 151 | * @platform_mode: Whether or not to use the platform driver. |
| 152 | * | ||
| 153 | * Use the platform driver prepare to prepare the machine for switching to the | ||
| 154 | * normal mode of operation. | ||
| 155 | * | ||
| 156 | * This routine is called on one CPU with interrupts disabled. | ||
| 152 | */ | 157 | */ |
| 153 | |||
| 154 | static void platform_leave(int platform_mode) | 158 | static void platform_leave(int platform_mode) |
| 155 | { | 159 | { |
| 156 | if (platform_mode && hibernation_ops) | 160 | if (platform_mode && hibernation_ops) |
| @@ -158,10 +162,14 @@ static void platform_leave(int platform_mode) | |||
| 158 | } | 162 | } |
| 159 | 163 | ||
| 160 | /** | 164 | /** |
| 161 | * platform_finish - switch the machine to the normal mode of operation | 165 | * platform_finish - Call platform to switch the system to the working state. |
| 162 | * using the platform driver (must be called after platform_prepare()) | 166 | * @platform_mode: Whether or not to use the platform driver. |
| 167 | * | ||
| 168 | * Use the platform driver to switch the machine to the normal mode of | ||
| 169 | * operation. | ||
| 170 | * | ||
| 171 | * This routine must be called after platform_prepare(). | ||
| 163 | */ | 172 | */ |
| 164 | |||
| 165 | static void platform_finish(int platform_mode) | 173 | static void platform_finish(int platform_mode) |
| 166 | { | 174 | { |
| 167 | if (platform_mode && hibernation_ops) | 175 | if (platform_mode && hibernation_ops) |
| @@ -169,11 +177,15 @@ static void platform_finish(int platform_mode) | |||
| 169 | } | 177 | } |
| 170 | 178 | ||
| 171 | /** | 179 | /** |
| 172 | * platform_pre_restore - prepare the platform for the restoration from a | 180 | * platform_pre_restore - Prepare for hibernate image restoration. |
| 173 | * hibernation image. If the restore fails after this function has been | 181 | * @platform_mode: Whether or not to use the platform driver. |
| 174 | * called, platform_restore_cleanup() must be called. | 182 | * |
| 183 | * Use the platform driver to prepare the system for resume from a hibernation | ||
| 184 | * image. | ||
| 185 | * | ||
| 186 | * If the restore fails after this function has been called, | ||
| 187 | * platform_restore_cleanup() must be called. | ||
| 175 | */ | 188 | */ |
| 176 | |||
| 177 | static int platform_pre_restore(int platform_mode) | 189 | static int platform_pre_restore(int platform_mode) |
| 178 | { | 190 | { |
| 179 | return (platform_mode && hibernation_ops) ? | 191 | return (platform_mode && hibernation_ops) ? |
| @@ -181,12 +193,16 @@ static int platform_pre_restore(int platform_mode) | |||
| 181 | } | 193 | } |
| 182 | 194 | ||
| 183 | /** | 195 | /** |
| 184 | * platform_restore_cleanup - switch the platform to the normal mode of | 196 | * platform_restore_cleanup - Switch to the working state after failing restore. |
| 185 | * operation after a failing restore. If platform_pre_restore() has been | 197 | * @platform_mode: Whether or not to use the platform driver. |
| 186 | * called before the failing restore, this function must be called too, | 198 | * |
| 187 | * regardless of the result of platform_pre_restore(). | 199 | * Use the platform driver to switch the system to the normal mode of operation |
| 200 | * after a failing restore. | ||
| 201 | * | ||
| 202 | * If platform_pre_restore() has been called before the failing restore, this | ||
| 203 | * function must be called too, regardless of the result of | ||
| 204 | * platform_pre_restore(). | ||
| 188 | */ | 205 | */ |
| 189 | |||
| 190 | static void platform_restore_cleanup(int platform_mode) | 206 | static void platform_restore_cleanup(int platform_mode) |
| 191 | { | 207 | { |
| 192 | if (platform_mode && hibernation_ops) | 208 | if (platform_mode && hibernation_ops) |
| @@ -194,10 +210,9 @@ static void platform_restore_cleanup(int platform_mode) | |||
| 194 | } | 210 | } |
| 195 | 211 | ||
| 196 | /** | 212 | /** |
| 197 | * platform_recover - recover the platform from a failure to suspend | 213 | * platform_recover - Recover from a failure to suspend devices. |
| 198 | * devices. | 214 | * @platform_mode: Whether or not to use the platform driver. |
| 199 | */ | 215 | */ |
| 200 | |||
| 201 | static void platform_recover(int platform_mode) | 216 | static void platform_recover(int platform_mode) |
| 202 | { | 217 | { |
| 203 | if (platform_mode && hibernation_ops && hibernation_ops->recover) | 218 | if (platform_mode && hibernation_ops && hibernation_ops->recover) |
| @@ -205,13 +220,12 @@ static void platform_recover(int platform_mode) | |||
| 205 | } | 220 | } |
| 206 | 221 | ||
| 207 | /** | 222 | /** |
| 208 | * swsusp_show_speed - print the time elapsed between two events. | 223 | * swsusp_show_speed - Print time elapsed between two events during hibernation. |
| 209 | * @start: Starting event. | 224 | * @start: Starting event. |
| 210 | * @stop: Final event. | 225 | * @stop: Final event. |
| 211 | * @nr_pages - number of pages processed between @start and @stop | 226 | * @nr_pages: Number of memory pages processed between @start and @stop. |
| 212 | * @msg - introductory message to print | 227 | * @msg: Additional diagnostic message to print. |
| 213 | */ | 228 | */ |
| 214 | |||
| 215 | void swsusp_show_speed(struct timeval *start, struct timeval *stop, | 229 | void swsusp_show_speed(struct timeval *start, struct timeval *stop, |
| 216 | unsigned nr_pages, char *msg) | 230 | unsigned nr_pages, char *msg) |
| 217 | { | 231 | { |
| @@ -234,11 +248,14 @@ void swsusp_show_speed(struct timeval *start, struct timeval *stop, | |||
| 234 | } | ||
