diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-05-17 13:12:18 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-05-17 13:12:18 -0400 |
commit | 582078ee3d7dacd74a7b3fe02ea258cadf32b602 (patch) | |
tree | 6aa9c20c9df5367782716ef4960e4fac1b9b24ff /drivers/ide/ide-io.c | |
parent | 5f582c8e2193e3848039de87e6a3ace7cbc7ed88 (diff) |
ide: merge ide_disk_special() into do_special() (v2)
While at it:
- change debug printk() level to KERN_DEBUG and use __func__
- update documentation
v2:
- fix DEBUG build (noticed by Sergei)
There should be no functional changes caused by this patch.
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-io.c')
-rw-r--r-- | drivers/ide/ide-io.c | 44 |
1 files changed, 18 insertions, 26 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index ef806ab88fb4..18557683ed5a 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
@@ -184,11 +184,28 @@ static void ide_tf_set_setmult_cmd(ide_drive_t *drive, struct ide_taskfile *tf) | |||
184 | tf->command = ATA_CMD_SET_MULTI; | 184 | tf->command = ATA_CMD_SET_MULTI; |
185 | } | 185 | } |
186 | 186 | ||
187 | static ide_startstop_t ide_disk_special(ide_drive_t *drive) | 187 | /** |
188 | * do_special - issue some special commands | ||
189 | * @drive: drive the command is for | ||
190 | * | ||
191 | * do_special() is used to issue ATA_CMD_INIT_DEV_PARAMS, | ||
192 | * ATA_CMD_RESTORE and ATA_CMD_SET_MULTI commands to a drive. | ||
193 | */ | ||
194 | |||
195 | static ide_startstop_t do_special(ide_drive_t *drive) | ||
188 | { | 196 | { |
189 | special_t *s = &drive->special; | 197 | special_t *s = &drive->special; |
190 | struct ide_cmd cmd; | 198 | struct ide_cmd cmd; |
191 | 199 | ||
200 | #ifdef DEBUG | ||
201 | printk(KERN_DEBUG "%s: %s: 0x%02x\n", drive->name, __func__, s->all); | ||
202 | #endif | ||
203 | if (drive->media != ide_disk) { | ||
204 | s->all = 0; | ||
205 | drive->mult_req = 0; | ||
206 | return ide_stopped; | ||
207 | } | ||
208 | |||
192 | memset(&cmd, 0, sizeof(cmd)); | 209 | memset(&cmd, 0, sizeof(cmd)); |
193 | cmd.protocol = ATA_PROT_NODATA; | 210 | cmd.protocol = ATA_PROT_NODATA; |
194 | 211 | ||
@@ -213,31 +230,6 @@ static ide_startstop_t ide_disk_special(ide_drive_t *drive) | |||
213 | return ide_started; | 230 | return ide_started; |
214 | } | 231 | } |
215 | 232 | ||
216 | /** | ||
217 | * do_special - issue some special commands | ||
218 | * @drive: drive the command is for | ||
219 | * | ||
220 | * do_special() is used to issue ATA_CMD_INIT_DEV_PARAMS, | ||
221 | * ATA_CMD_RESTORE and ATA_CMD_SET_MULTI commands to a drive. | ||
222 | * | ||
223 | * It used to do much more, but has been scaled back. | ||
224 | */ | ||
225 | |||
226 | static ide_startstop_t do_special (ide_drive_t *drive) | ||
227 | { | ||
228 | special_t *s = &drive->special; | ||
229 | |||
230 | #ifdef DEBUG | ||
231 | printk("%s: do_special: 0x%02x\n", drive->name, s->all); | ||
232 | #endif | ||
233 | if (drive->media == ide_disk) | ||
234 | return ide_disk_special(drive); | ||
235 | |||
236 | s->all = 0; | ||
237 | drive->mult_req = 0; | ||
238 | return ide_stopped; | ||
239 | } | ||
240 | |||
241 | void ide_map_sg(ide_drive_t *drive, struct ide_cmd *cmd) | 233 | void ide_map_sg(ide_drive_t *drive, struct ide_cmd *cmd) |
242 | { | 234 | { |
243 | ide_hwif_t *hwif = drive->hwif; | 235 | ide_hwif_t *hwif = drive->hwif; |