Skip to content

Commit 582078e

Browse files
committed
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>
1 parent 5f582c8 commit 582078e

1 file changed

Lines changed: 18 additions & 26 deletions

File tree

‎drivers/ide/ide-io.c‎

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,28 @@ static void ide_tf_set_setmult_cmd(ide_drive_t *drive, struct ide_taskfile *tf)
184184
tf->command = ATA_CMD_SET_MULTI;
185185
}
186186

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)
188196
{
189197
special_t *s = &drive->special;
190198
struct ide_cmd cmd;
191199

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+
192209
memset(&cmd, 0, sizeof(cmd));
193210
cmd.protocol = ATA_PROT_NODATA;
194211

@@ -213,31 +230,6 @@ static ide_startstop_t ide_disk_special(ide_drive_t *drive)
213230
return ide_started;
214231
}
215232

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-
241233
void ide_map_sg(ide_drive_t *drive, struct ide_cmd *cmd)
242234
{
243235
ide_hwif_t *hwif = drive->hwif;

0 commit comments

Comments
 (0)