@@ -7,19 +7,16 @@ int generic_ide_suspend(struct device *dev, pm_message_t mesg)
77 ide_hwif_t * hwif = drive -> hwif ;
88 struct request * rq ;
99 struct request_pm_state rqpm ;
10- struct ide_cmd cmd ;
1110 int ret ;
1211
1312 /* call ACPI _GTM only once */
1413 if ((drive -> dn & 1 ) == 0 || pair == NULL )
1514 ide_acpi_get_timing (hwif );
1615
1716 memset (& rqpm , 0 , sizeof (rqpm ));
18- memset (& cmd , 0 , sizeof (cmd ));
1917 rq = blk_get_request (drive -> queue , READ , __GFP_WAIT );
2018 rq -> cmd_type = REQ_TYPE_PM_SUSPEND ;
21- rq -> special = & cmd ;
22- rq -> data = & rqpm ;
19+ rq -> special = & rqpm ;
2320 rqpm .pm_step = IDE_PM_START_SUSPEND ;
2421 if (mesg .event == PM_EVENT_PRETHAW )
2522 mesg .event = PM_EVENT_FREEZE ;
@@ -41,7 +38,6 @@ int generic_ide_resume(struct device *dev)
4138 ide_hwif_t * hwif = drive -> hwif ;
4239 struct request * rq ;
4340 struct request_pm_state rqpm ;
44- struct ide_cmd cmd ;
4541 int err ;
4642
4743 /* call ACPI _PS0 / _STM only once */
@@ -53,12 +49,10 @@ int generic_ide_resume(struct device *dev)
5349 ide_acpi_exec_tfs (drive );
5450
5551 memset (& rqpm , 0 , sizeof (rqpm ));
56- memset (& cmd , 0 , sizeof (cmd ));
5752 rq = blk_get_request (drive -> queue , READ , __GFP_WAIT );
5853 rq -> cmd_type = REQ_TYPE_PM_RESUME ;
5954 rq -> cmd_flags |= REQ_PREEMPT ;
60- rq -> special = & cmd ;
61- rq -> data = & rqpm ;
55+ rq -> special = & rqpm ;
6256 rqpm .pm_step = IDE_PM_START_RESUME ;
6357 rqpm .pm_state = PM_EVENT_ON ;
6458
@@ -77,7 +71,7 @@ int generic_ide_resume(struct device *dev)
7771
7872void ide_complete_power_step (ide_drive_t * drive , struct request * rq )
7973{
80- struct request_pm_state * pm = rq -> data ;
74+ struct request_pm_state * pm = rq -> special ;
8175
8276#ifdef DEBUG_PM
8377 printk (KERN_INFO "%s: complete_power_step(step: %d)\n" ,
@@ -107,10 +101,8 @@ void ide_complete_power_step(ide_drive_t *drive, struct request *rq)
107101
108102ide_startstop_t ide_start_power_step (ide_drive_t * drive , struct request * rq )
109103{
110- struct request_pm_state * pm = rq -> data ;
111- struct ide_cmd * cmd = rq -> special ;
112-
113- memset (cmd , 0 , sizeof (* cmd ));
104+ struct request_pm_state * pm = rq -> special ;
105+ struct ide_cmd cmd = { };
114106
115107 switch (pm -> pm_step ) {
116108 case IDE_PM_FLUSH_CACHE : /* Suspend step 1 (flush cache) */
@@ -123,12 +115,12 @@ ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *rq)
123115 return ide_stopped ;
124116 }
125117 if (ata_id_flush_ext_enabled (drive -> id ))
126- cmd -> tf .command = ATA_CMD_FLUSH_EXT ;
118+ cmd . tf .command = ATA_CMD_FLUSH_EXT ;
127119 else
128- cmd -> tf .command = ATA_CMD_FLUSH ;
120+ cmd . tf .command = ATA_CMD_FLUSH ;
129121 goto out_do_tf ;
130122 case IDE_PM_STANDBY : /* Suspend step 2 (standby) */
131- cmd -> tf .command = ATA_CMD_STANDBYNOW1 ;
123+ cmd . tf .command = ATA_CMD_STANDBYNOW1 ;
132124 goto out_do_tf ;
133125 case IDE_PM_RESTORE_PIO : /* Resume step 1 (restore PIO) */
134126 ide_set_max_pio (drive );
@@ -141,7 +133,7 @@ ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *rq)
141133 ide_complete_power_step (drive , rq );
142134 return ide_stopped ;
143135 case IDE_PM_IDLE : /* Resume step 2 (idle) */
144- cmd -> tf .command = ATA_CMD_IDLEIMMEDIATE ;
136+ cmd . tf .command = ATA_CMD_IDLEIMMEDIATE ;
145137 goto out_do_tf ;
146138 case IDE_PM_RESTORE_DMA : /* Resume step 3 (restore DMA) */
147139 /*
@@ -163,11 +155,11 @@ ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *rq)
163155 return ide_stopped ;
164156
165157out_do_tf :
166- cmd -> valid .out .tf = IDE_VALID_OUT_TF | IDE_VALID_DEVICE ;
167- cmd -> valid .in .tf = IDE_VALID_IN_TF | IDE_VALID_DEVICE ;
168- cmd -> protocol = ATA_PROT_NODATA ;
158+ cmd . valid .out .tf = IDE_VALID_OUT_TF | IDE_VALID_DEVICE ;
159+ cmd . valid .in .tf = IDE_VALID_IN_TF | IDE_VALID_DEVICE ;
160+ cmd . protocol = ATA_PROT_NODATA ;
169161
170- return do_rw_taskfile (drive , cmd );
162+ return do_rw_taskfile (drive , & cmd );
171163}
172164
173165/**
@@ -181,7 +173,7 @@ ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *rq)
181173void ide_complete_pm_rq (ide_drive_t * drive , struct request * rq )
182174{
183175 struct request_queue * q = drive -> queue ;
184- struct request_pm_state * pm = rq -> data ;
176+ struct request_pm_state * pm = rq -> special ;
185177 unsigned long flags ;
186178
187179 ide_complete_power_step (drive , rq );
@@ -207,7 +199,7 @@ void ide_complete_pm_rq(ide_drive_t *drive, struct request *rq)
207199
208200void ide_check_pm_state (ide_drive_t * drive , struct request * rq )
209201{
210- struct request_pm_state * pm = rq -> data ;
202+ struct request_pm_state * pm = rq -> special ;
211203
212204 if (blk_pm_suspend_request (rq ) &&
213205 pm -> pm_step == IDE_PM_START_SUSPEND )
0 commit comments