@@ -132,21 +132,6 @@ int ide_end_request (ide_drive_t *drive, int uptodate, int nr_sectors)
132132}
133133EXPORT_SYMBOL (ide_end_request );
134134
135- /*
136- * Power Management state machine. This one is rather trivial for now,
137- * we should probably add more, like switching back to PIO on suspend
138- * to help some BIOSes, re-do the door locking on resume, etc...
139- */
140-
141- enum {
142- ide_pm_flush_cache = ide_pm_state_start_suspend ,
143- idedisk_pm_standby ,
144-
145- idedisk_pm_restore_pio = ide_pm_state_start_resume ,
146- idedisk_pm_idle ,
147- ide_pm_restore_dma ,
148- };
149-
150135static void ide_complete_power_step (ide_drive_t * drive , struct request * rq , u8 stat , u8 error )
151136{
152137 struct request_pm_state * pm = rq -> data ;
@@ -155,20 +140,20 @@ static void ide_complete_power_step(ide_drive_t *drive, struct request *rq, u8 s
155140 return ;
156141
157142 switch (pm -> pm_step ) {
158- case ide_pm_flush_cache : /* Suspend step 1 (flush cache) complete */
143+ case IDE_PM_FLUSH_CACHE : /* Suspend step 1 (flush cache) */
159144 if (pm -> pm_state == PM_EVENT_FREEZE )
160- pm -> pm_step = ide_pm_state_completed ;
145+ pm -> pm_step = IDE_PM_COMPLETED ;
161146 else
162- pm -> pm_step = idedisk_pm_standby ;
147+ pm -> pm_step = IDE_PM_STANDBY ;
163148 break ;
164- case idedisk_pm_standby : /* Suspend step 2 (standby) complete */
165- pm -> pm_step = ide_pm_state_completed ;
149+ case IDE_PM_STANDBY : /* Suspend step 2 (standby) */
150+ pm -> pm_step = IDE_PM_COMPLETED ;
166151 break ;
167- case idedisk_pm_restore_pio : /* Resume step 1 complete */
168- pm -> pm_step = idedisk_pm_idle ;
152+ case IDE_PM_RESTORE_PIO : /* Resume step 1 (restore PIO) */
153+ pm -> pm_step = IDE_PM_IDLE ;
169154 break ;
170- case idedisk_pm_idle : /* Resume step 2 (idle) complete */
171- pm -> pm_step = ide_pm_restore_dma ;
155+ case IDE_PM_IDLE : /* Resume step 2 (idle)*/
156+ pm -> pm_step = IDE_PM_RESTORE_DMA ;
172157 break ;
173158 }
174159}
@@ -181,7 +166,7 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *
181166 memset (args , 0 , sizeof (* args ));
182167
183168 switch (pm -> pm_step ) {
184- case ide_pm_flush_cache : /* Suspend step 1 (flush cache) */
169+ case IDE_PM_FLUSH_CACHE : /* Suspend step 1 (flush cache) */
185170 if (drive -> media != ide_disk )
186171 break ;
187172 /* Not supported? Switch to next step now. */
@@ -195,27 +180,23 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *
195180 else
196181 args -> tf .command = ATA_CMD_FLUSH ;
197182 goto out_do_tf ;
198-
199- case idedisk_pm_standby : /* Suspend step 2 (standby) */
183+ case IDE_PM_STANDBY : /* Suspend step 2 (standby) */
200184 args -> tf .command = ATA_CMD_STANDBYNOW1 ;
201185 goto out_do_tf ;
202-
203- case idedisk_pm_restore_pio : /* Resume step 1 (restore PIO) */
186+ case IDE_PM_RESTORE_PIO : /* Resume step 1 (restore PIO) */
204187 ide_set_max_pio (drive );
205188 /*
206- * skip idedisk_pm_idle for ATAPI devices
189+ * skip IDE_PM_IDLE for ATAPI devices
207190 */
208191 if (drive -> media != ide_disk )
209- pm -> pm_step = ide_pm_restore_dma ;
192+ pm -> pm_step = IDE_PM_RESTORE_DMA ;
210193 else
211194 ide_complete_power_step (drive , rq , 0 , 0 );
212195 return ide_stopped ;
213-
214- case idedisk_pm_idle : /* Resume step 2 (idle) */
196+ case IDE_PM_IDLE : /* Resume step 2 (idle) */
215197 args -> tf .command = ATA_CMD_IDLEIMMEDIATE ;
216198 goto out_do_tf ;
217-
218- case ide_pm_restore_dma : /* Resume step 3 (restore DMA) */
199+ case IDE_PM_RESTORE_DMA : /* Resume step 3 (restore DMA) */
219200 /*
220201 * Right now, all we do is call ide_set_dma(drive),
221202 * we could be smarter and check for current xfer_speed
@@ -229,7 +210,8 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *
229210 ide_set_dma (drive );
230211 break ;
231212 }
232- pm -> pm_step = ide_pm_state_completed ;
213+
214+ pm -> pm_step = IDE_PM_COMPLETED ;
233215 return ide_stopped ;
234216
235217out_do_tf :
@@ -345,7 +327,7 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
345327 drive -> name , rq -> pm -> pm_step , stat , err );
346328#endif
347329 ide_complete_power_step (drive , rq , stat , err );
348- if (pm -> pm_step == ide_pm_state_completed )
330+ if (pm -> pm_step == IDE_PM_COMPLETED )
349331 ide_complete_pm_request (drive , rq );
350332 return ;
351333 }
@@ -778,11 +760,11 @@ static void ide_check_pm_state(ide_drive_t *drive, struct request *rq)
778760 struct request_pm_state * pm = rq -> data ;
779761
780762 if (blk_pm_suspend_request (rq ) &&
781- pm -> pm_step == ide_pm_state_start_suspend )
763+ pm -> pm_step == IDE_PM_START_SUSPEND )
782764 /* Mark drive blocked when starting the suspend sequence. */
783765 drive -> dev_flags |= IDE_DFLAG_BLOCKED ;
784766 else if (blk_pm_resume_request (rq ) &&
785- pm -> pm_step == ide_pm_state_start_resume ) {
767+ pm -> pm_step == IDE_PM_START_RESUME ) {
786768 /*
787769 * The first thing we do on wakeup is to wait for BSY bit to
788770 * go away (with a looong timeout) as a drive on this hwif may
@@ -862,7 +844,7 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq)
862844#endif
863845 startstop = ide_start_power_step (drive , rq );
864846 if (startstop == ide_stopped &&
865- pm -> pm_step == ide_pm_state_completed )
847+ pm -> pm_step == IDE_PM_COMPLETED )
866848 ide_complete_pm_request (drive , rq );
867849 return startstop ;
868850 } else if (!rq -> rq_disk && blk_special_request (rq ))
0 commit comments