aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-pm.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-27 07:46:37 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-27 07:46:37 -0400
commit22aa4b32a19b1f231d4ce7e9af6354b577a22a35 (patch)
tree3e773e7102e4ea6bb6b4c00edce442c4e8f37edb /drivers/ide/ide-pm.c
parente6830a86c260d73c6f370aa7ed17ee6c71e5ee05 (diff)
ide: remove ide_task_t typedef
While at it: - rename struct ide_task_s to struct ide_cmd - remove stale comments from idedisk_{read_native,set}_max_address() - drop unused 'cmd' argument from ide_{cmd,task}_ioctl() - drop unused 'task' argument from tx4939ide_tf_load_fixup() - rename ide_complete_task() to ide_complete_cmd() - use consistent naming for struct ide_cmd variables There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-pm.c')
-rw-r--r--drivers/ide/ide-pm.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/drivers/ide/ide-pm.c b/drivers/ide/ide-pm.c
index 74c7c2bbe0fd..5c9fc20f95b5 100644
--- a/drivers/ide/ide-pm.c
+++ b/drivers/ide/ide-pm.c
@@ -8,7 +8,7 @@ int generic_ide_suspend(struct device *dev, pm_message_t mesg)
8 ide_hwif_t *hwif = drive->hwif; 8 ide_hwif_t *hwif = drive->hwif;
9 struct request *rq; 9 struct request *rq;
10 struct request_pm_state rqpm; 10 struct request_pm_state rqpm;
11 ide_task_t args; 11 struct ide_cmd cmd;
12 int ret; 12 int ret;
13 13
14 /* call ACPI _GTM only once */ 14 /* call ACPI _GTM only once */
@@ -16,10 +16,10 @@ int generic_ide_suspend(struct device *dev, pm_message_t mesg)
16 ide_acpi_get_timing(hwif); 16 ide_acpi_get_timing(hwif);
17 17
18 memset(&rqpm, 0, sizeof(rqpm)); 18 memset(&rqpm, 0, sizeof(rqpm));
19 memset(&args, 0, sizeof(args)); 19 memset(&cmd, 0, sizeof(cmd));
20 rq = blk_get_request(drive->queue, READ, __GFP_WAIT); 20 rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
21 rq->cmd_type = REQ_TYPE_PM_SUSPEND; 21 rq->cmd_type = REQ_TYPE_PM_SUSPEND;
22 rq->special = &args; 22 rq->special = &cmd;
23 rq->data = &rqpm; 23 rq->data = &rqpm;
24 rqpm.pm_step = IDE_PM_START_SUSPEND; 24 rqpm.pm_step = IDE_PM_START_SUSPEND;
25 if (mesg.event == PM_EVENT_PRETHAW) 25 if (mesg.event == PM_EVENT_PRETHAW)
@@ -42,7 +42,7 @@ int generic_ide_resume(struct device *dev)
42 ide_hwif_t *hwif = drive->hwif; 42 ide_hwif_t *hwif = drive->hwif;
43 struct request *rq; 43 struct request *rq;
44 struct request_pm_state rqpm; 44 struct request_pm_state rqpm;
45 ide_task_t args; 45 struct ide_cmd cmd;
46 int err; 46 int err;
47 47
48 /* call ACPI _PS0 / _STM only once */ 48 /* call ACPI _PS0 / _STM only once */
@@ -54,11 +54,11 @@ int generic_ide_resume(struct device *dev)
54 ide_acpi_exec_tfs(drive); 54 ide_acpi_exec_tfs(drive);
55 55
56 memset(&rqpm, 0, sizeof(rqpm)); 56 memset(&rqpm, 0, sizeof(rqpm));
57 memset(&args, 0, sizeof(args)); 57 memset(&cmd, 0, sizeof(cmd));
58 rq = blk_get_request(drive->queue, READ, __GFP_WAIT); 58 rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
59 rq->cmd_type = REQ_TYPE_PM_RESUME; 59 rq->cmd_type = REQ_TYPE_PM_RESUME;
60 rq->cmd_flags |= REQ_PREEMPT; 60 rq->cmd_flags |= REQ_PREEMPT;
61 rq->special = &args; 61 rq->special = &cmd;
62 rq->data = &rqpm; 62 rq->data = &rqpm;
63 rqpm.pm_step = IDE_PM_START_RESUME; 63 rqpm.pm_step = IDE_PM_START_RESUME;
64 rqpm.pm_state = PM_EVENT_ON; 64 rqpm.pm_state = PM_EVENT_ON;
@@ -109,9 +109,9 @@ void ide_complete_power_step(ide_drive_t *drive, struct request *rq)
109ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *rq) 109ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *rq)
110{ 110{
111 struct request_pm_state *pm = rq->data; 111 struct request_pm_state *pm = rq->data;
112 ide_task_t *args = rq->special; 112 struct ide_cmd *cmd = rq->special;
113 113
114 memset(args, 0, sizeof(*args)); 114 memset(cmd, 0, sizeof(*cmd));
115 115
116 switch (pm->pm_step) { 116 switch (pm->pm_step) {
117 case IDE_PM_FLUSH_CACHE: /* Suspend step 1 (flush cache) */ 117 case IDE_PM_FLUSH_CACHE: /* Suspend step 1 (flush cache) */
@@ -124,12 +124,12 @@ ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *rq)
124 return ide_stopped; 124 return ide_stopped;
125 } 125 }
126 if (ata_id_flush_ext_enabled(drive->id)) 126 if (ata_id_flush_ext_enabled(drive->id))
127 args->tf.command = ATA_CMD_FLUSH_EXT; 127 cmd->tf.command = ATA_CMD_FLUSH_EXT;
128 else 128 else
129 args->tf.command = ATA_CMD_FLUSH; 129 cmd->tf.command = ATA_CMD_FLUSH;
130 goto out_do_tf; 130 goto out_do_tf;
131 case IDE_PM_STANDBY: /* Suspend step 2 (standby) */ 131 case IDE_PM_STANDBY: /* Suspend step 2 (standby) */
132 args->tf.command = ATA_CMD_STANDBYNOW1; 132 cmd->tf.command = ATA_CMD_STANDBYNOW1;
133 goto out_do_tf; 133 goto out_do_tf;
134 case IDE_PM_RESTORE_PIO: /* Resume step 1 (restore PIO) */ 134 case IDE_PM_RESTORE_PIO: /* Resume step 1 (restore PIO) */
135 ide_set_max_pio(drive); 135 ide_set_max_pio(drive);
@@ -142,7 +142,7 @@ ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *rq)
142 ide_complete_power_step(drive, rq); 142 ide_complete_power_step(drive, rq);
143 return ide_stopped; 143 return ide_stopped;
144 case IDE_PM_IDLE: /* Resume step 2 (idle) */ 144 case IDE_PM_IDLE: /* Resume step 2 (idle) */
145 args->tf.command = ATA_CMD_IDLEIMMEDIATE; 145 cmd->tf.command = ATA_CMD_IDLEIMMEDIATE;
146 goto out_do_tf; 146 goto out_do_tf;
147 case IDE_PM_RESTORE_DMA: /* Resume step 3 (restore DMA) */ 147 case IDE_PM_RESTORE_DMA: /* Resume step 3 (restore DMA) */
148 /* 148 /*
@@ -160,12 +160,14 @@ ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *rq)
160 } 160 }
161 161
162 pm->pm_step = IDE_PM_COMPLETED; 162 pm->pm_step = IDE_PM_COMPLETED;
163
163 return ide_stopped; 164 return ide_stopped;
164 165
165out_do_tf: 166out_do_tf:
166 args->tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE; 167 cmd->tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
167 args->data_phase = TASKFILE_NO_DATA; 168 cmd->data_phase = TASKFILE_NO_DATA;
168 return do_rw_taskfile(drive, args); 169
170 return do_rw_taskfile(drive, cmd);
169} 171}
170 172
171/** 173/**