Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ide: inline SELECT_DRIVE()

Since SELECT_DRIVE() has boiled down to a mere dev_select() method call, it now
makes sense to just inline it...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

authored by

Sergei Shtylyov and committed by
Bartlomiej Zolnierkiewicz
fdd88f0a abb596b2

+18 -21
+4 -3
drivers/ide/ide-eh.c
··· 165 165 static ide_startstop_t atapi_reset_pollfunc(ide_drive_t *drive) 166 166 { 167 167 ide_hwif_t *hwif = drive->hwif; 168 + const struct ide_tp_ops *tp_ops = hwif->tp_ops; 168 169 u8 stat; 169 170 170 - SELECT_DRIVE(drive); 171 + tp_ops->dev_select(drive); 171 172 udelay(10); 172 - stat = hwif->tp_ops->read_status(hwif); 173 + stat = tp_ops->read_status(hwif); 173 174 174 175 if (OK_STAT(stat, 0, ATA_BUSY)) 175 176 printk(KERN_INFO "%s: ATAPI reset complete\n", drive->name); ··· 349 348 /* For an ATAPI device, first try an ATAPI SRST. */ 350 349 if (drive->media != ide_disk && !do_not_try_atapi) { 351 350 pre_reset(drive); 352 - SELECT_DRIVE(drive); 351 + tp_ops->dev_select(drive); 353 352 udelay(20); 354 353 tp_ops->exec_command(hwif, ATA_CMD_DEV_RESET); 355 354 ndelay(400);
+1 -1
drivers/ide/ide-io.c
··· 348 348 if (blk_pm_request(rq)) 349 349 ide_check_pm_state(drive, rq); 350 350 351 - SELECT_DRIVE(drive); 351 + drive->hwif->tp_ops->dev_select(drive); 352 352 if (ide_wait_stat(&startstop, drive, drive->ready_stat, 353 353 ATA_BUSY | ATA_DRQ, WAIT_READY)) { 354 354 printk(KERN_ERR "%s: drive not ready for command\n", drive->name);
+1 -6
drivers/ide/ide-iops.c
··· 27 27 #include <asm/uaccess.h> 28 28 #include <asm/io.h> 29 29 30 - void SELECT_DRIVE(ide_drive_t *drive) 31 - { 32 - drive->hwif->tp_ops->dev_select(drive); 33 - } 34 - 35 30 void SELECT_MASK(ide_drive_t *drive, int mask) 36 31 { 37 32 const struct ide_port_ops *port_ops = drive->hwif->port_ops; ··· 342 347 disable_irq_nosync(hwif->irq); 343 348 344 349 udelay(1); 345 - SELECT_DRIVE(drive); 350 + tp_ops->dev_select(drive); 346 351 SELECT_MASK(drive, 1); 347 352 udelay(1); 348 353 tp_ops->write_devctl(hwif, ATA_NIEN | ATA_DEVCTL_OBS);
+3 -2
drivers/ide/ide-pm.c
··· 223 223 * point. 224 224 */ 225 225 ide_hwif_t *hwif = drive->hwif; 226 + const struct ide_tp_ops *tp_ops = hwif->tp_ops; 226 227 struct request_queue *q = drive->queue; 227 228 unsigned long flags; 228 229 int rc; ··· 233 232 rc = ide_wait_not_busy(hwif, 35000); 234 233 if (rc) 235 234 printk(KERN_WARNING "%s: bus not ready on wakeup\n", drive->name); 236 - SELECT_DRIVE(drive); 237 - hwif->tp_ops->write_devctl(hwif, ATA_DEVCTL_OBS); 235 + tp_ops->dev_select(drive); 236 + tp_ops->write_devctl(hwif, ATA_DEVCTL_OBS); 238 237 rc = ide_wait_not_busy(hwif, 100000); 239 238 if (rc) 240 239 printk(KERN_WARNING "%s: drive not ready on wakeup\n", drive->name);
+8 -7
drivers/ide/ide-probe.c
··· 390 390 * (e.g. crw9624 as drive0 with disk as slave) 391 391 */ 392 392 msleep(50); 393 - SELECT_DRIVE(drive); 393 + tp_ops->dev_select(drive); 394 394 msleep(50); 395 395 396 396 if (ide_read_device(drive) != drive->select && present == 0) { 397 397 if (drive->dn & 1) { 398 398 /* exit with drive0 selected */ 399 - SELECT_DRIVE(hwif->devices[0]); 399 + tp_ops->dev_select(hwif->devices[0]); 400 400 /* allow ATA_BUSY to assert & clear */ 401 401 msleep(50); 402 402 } ··· 422 422 printk(KERN_ERR "%s: no response (status = 0x%02x), " 423 423 "resetting drive\n", drive->name, stat); 424 424 msleep(50); 425 - SELECT_DRIVE(drive); 425 + tp_ops->dev_select(drive); 426 426 msleep(50); 427 427 tp_ops->exec_command(hwif, ATA_CMD_DEV_RESET); 428 428 (void)ide_busy_sleep(hwif, WAIT_WORSTCASE, 0); ··· 441 441 } 442 442 if (drive->dn & 1) { 443 443 /* exit with drive0 selected */ 444 - SELECT_DRIVE(hwif->devices[0]); 444 + tp_ops->dev_select(hwif->devices[0]); 445 445 msleep(50); 446 446 /* ensure drive irq is clear */ 447 447 (void)tp_ops->read_status(hwif); ··· 605 605 606 606 static int ide_port_wait_ready(ide_hwif_t *hwif) 607 607 { 608 + const struct ide_tp_ops *tp_ops = hwif->tp_ops; 608 609 ide_drive_t *drive; 609 610 int i, rc; 610 611 ··· 628 627 /* Ignore disks that we will not probe for later. */ 629 628 if ((drive->dev_flags & IDE_DFLAG_NOPROBE) == 0 || 630 629 (drive->dev_flags & IDE_DFLAG_PRESENT)) { 631 - SELECT_DRIVE(drive); 632 - hwif->tp_ops->write_devctl(hwif, ATA_DEVCTL_OBS); 630 + tp_ops->dev_select(drive); 631 + tp_ops->write_devctl(hwif, ATA_DEVCTL_OBS); 633 632 mdelay(2); 634 633 rc = ide_wait_not_busy(hwif, 35000); 635 634 if (rc) ··· 641 640 out: 642 641 /* Exit function with master reselected (let's be sane) */ 643 642 if (i) 644 - SELECT_DRIVE(hwif->devices[0]); 643 + tp_ops->dev_select(hwif->devices[0]); 645 644 646 645 return rc; 647 646 }
+1 -1
drivers/ide/ns87415.c
··· 262 262 #ifdef __sparc_v9__ 263 263 /* 264 264 * XXX: Reset the device, if we don't it will not respond to 265 - * SELECT_DRIVE() properly during first ide_probe_port(). 265 + * dev_select() properly during first ide_probe_port(). 266 266 */ 267 267 timeout = 10000; 268 268 outb(12, hwif->io_ports.ctl_addr);
-1
include/linux/ide.h
··· 1176 1176 void ide_input_data(ide_drive_t *, struct ide_cmd *, void *, unsigned int); 1177 1177 void ide_output_data(ide_drive_t *, struct ide_cmd *, void *, unsigned int); 1178 1178 1179 - extern void SELECT_DRIVE(ide_drive_t *); 1180 1179 void SELECT_MASK(ide_drive_t *, int); 1181 1180 1182 1181 u8 ide_read_error(ide_drive_t *);