aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergei Shtylyov <sshtylyov@ru.mvista.com>2009-03-31 14:15:33 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-31 14:15:33 -0400
commitfdd88f0af616db59a6a36bdf0185181d2b779f53 (patch)
tree9e0acaddc49f7354430457b07ee0a94757bbc314
parentabb596b25edac1ec1acc4ef53df190771661c3d2 (diff)
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>
-rw-r--r--drivers/ide/ide-eh.c7
-rw-r--r--drivers/ide/ide-io.c2
-rw-r--r--drivers/ide/ide-iops.c7
-rw-r--r--drivers/ide/ide-pm.c5
-rw-r--r--drivers/ide/ide-probe.c15
-rw-r--r--drivers/ide/ns87415.c2
-rw-r--r--include/linux/ide.h1
7 files changed, 18 insertions, 21 deletions
diff --git a/drivers/ide/ide-eh.c b/drivers/ide/ide-eh.c
index de4b7f1c9c9f..5d5fb961b5ce 100644
--- a/drivers/ide/ide-eh.c
+++ b/drivers/ide/ide-eh.c
@@ -165,11 +165,12 @@ static ide_startstop_t do_reset1(ide_drive_t *, int);
165static ide_startstop_t atapi_reset_pollfunc(ide_drive_t *drive) 165static ide_startstop_t atapi_reset_pollfunc(ide_drive_t *drive)
166{ 166{
167 ide_hwif_t *hwif = drive->hwif; 167 ide_hwif_t *hwif = drive->hwif;
168 const struct ide_tp_ops *tp_ops = hwif->tp_ops;
168 u8 stat; 169 u8 stat;
169 170
170 SELECT_DRIVE(drive); 171 tp_ops->dev_select(drive);
171 udelay(10); 172 udelay(10);
172 stat = hwif->tp_ops->read_status(hwif); 173 stat = tp_ops->read_status(hwif);
173 174
174 if (OK_STAT(stat, 0, ATA_BUSY)) 175 if (OK_STAT(stat, 0, ATA_BUSY))
175 printk(KERN_INFO "%s: ATAPI reset complete\n", drive->name); 176 printk(KERN_INFO "%s: ATAPI reset complete\n", drive->name);
@@ -348,7 +349,7 @@ static ide_startstop_t do_reset1(ide_drive_t *drive, int do_not_try_atapi)
348 /* For an ATAPI device, first try an ATAPI SRST. */ 349 /* For an ATAPI device, first try an ATAPI SRST. */
349 if (drive->media != ide_disk && !do_not_try_atapi) { 350 if (drive->media != ide_disk && !do_not_try_atapi) {
350 pre_reset(drive); 351 pre_reset(drive);
351 SELECT_DRIVE(drive); 352 tp_ops->dev_select(drive);
352 udelay(20); 353 udelay(20);
353 tp_ops->exec_command(hwif, ATA_CMD_DEV_RESET); 354 tp_ops->exec_command(hwif, ATA_CMD_DEV_RESET);
354 ndelay(400); 355 ndelay(400);
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 5589dce88674..1deb6d29b186 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -348,7 +348,7 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq)
348 if (blk_pm_request(rq)) 348 if (blk_pm_request(rq))
349 ide_check_pm_state(drive, rq); 349 ide_check_pm_state(drive, rq);
350 350
351 SELECT_DRIVE(drive); 351 drive->hwif->tp_ops->dev_select(drive);
352 if (ide_wait_stat(&startstop, drive, drive->ready_stat, 352 if (ide_wait_stat(&startstop, drive, drive->ready_stat,
353 ATA_BUSY | ATA_DRQ, WAIT_READY)) { 353 ATA_BUSY | ATA_DRQ, WAIT_READY)) {
354 printk(KERN_ERR "%s: drive not ready for command\n", drive->name); 354 printk(KERN_ERR "%s: drive not ready for command\n", drive->name);
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index dfb0ec317fa3..27bb70ddd459 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -27,11 +27,6 @@
27#include <asm/uaccess.h> 27#include <asm/uaccess.h>
28#include <asm/io.h> 28#include <asm/io.h>
29 29
30void SELECT_DRIVE(ide_drive_t *drive)
31{
32 drive->hwif->tp_ops->dev_select(drive);
33}
34
35void SELECT_MASK(ide_drive_t *drive, int mask) 30void SELECT_MASK(ide_drive_t *drive, int mask)
36{ 31{
37 const struct ide_port_ops *port_ops = drive->hwif->port_ops; 32 const struct ide_port_ops *port_ops = drive->hwif->port_ops;
@@ -347,7 +342,7 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
347 disable_irq_nosync(hwif->irq); 342 disable_irq_nosync(hwif->irq);
348 343
349 udelay(1); 344 udelay(1);
350 SELECT_DRIVE(drive); 345 tp_ops->dev_select(drive);
351 SELECT_MASK(drive, 1); 346 SELECT_MASK(drive, 1);
352 udelay(1); 347 udelay(1);
353 tp_ops->write_devctl(hwif, ATA_NIEN | ATA_DEVCTL_OBS); 348 tp_ops->write_devctl(hwif, ATA_NIEN | ATA_DEVCTL_OBS);
diff --git a/drivers/ide/ide-pm.c b/drivers/ide/ide-pm.c
index 20553d4c42a2..bb7858ebb7d1 100644
--- a/drivers/ide/ide-pm.c
+++ b/drivers/ide/ide-pm.c
@@ -223,6 +223,7 @@ void ide_check_pm_state(ide_drive_t *drive, struct request *rq)
223 * point. 223 * point.
224 */ 224 */
225 ide_hwif_t *hwif = drive->hwif; 225 ide_hwif_t *hwif = drive->hwif;
226 const struct ide_tp_ops *tp_ops = hwif->tp_ops;
226 struct request_queue *q = drive->queue; 227 struct request_queue *q = drive->queue;
227 unsigned long flags; 228 unsigned long flags;
228 int rc; 229 int rc;
@@ -232,8 +233,8 @@ void ide_check_pm_state(ide_drive_t *drive, struct request *rq)
232 rc = ide_wait_not_busy(hwif, 35000); 233 rc = ide_wait_not_busy(hwif, 35000);
233 if (rc) 234 if (rc)
234 printk(KERN_WARNING "%s: bus not ready on wakeup\n", drive->name); 235 printk(KERN_WARNING "%s: bus not ready on wakeup\n", drive->name);
235 SELECT_DRIVE(drive); 236 tp_ops->dev_select(drive);
236 hwif->tp_ops->write_devctl(hwif, ATA_DEVCTL_OBS); 237 tp_ops->write_devctl(hwif, ATA_DEVCTL_OBS);
237 rc = ide_wait_not_busy(hwif, 100000); 238 rc = ide_wait_not_busy(hwif, 100000);
238 if (rc) 239 if (rc)
239 printk(KERN_WARNING "%s: drive not ready on wakeup\n", drive->name); 240 printk(KERN_WARNING "%s: drive not ready on wakeup\n", drive->name);
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index d240f76b0da6..d8c1c3e735bb 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -390,13 +390,13 @@ static int do_probe (ide_drive_t *drive, u8 cmd)
390 * (e.g. crw9624 as drive0 with disk as slave) 390 * (e.g. crw9624 as drive0 with disk as slave)
391 */ 391 */
392 msleep(50); 392 msleep(50);
393 SELECT_DRIVE(drive); 393 tp_ops->dev_select(drive);
394 msleep(50); 394 msleep(50);
395 395
396 if (ide_read_device(drive) != drive->select && present == 0) { 396 if (ide_read_device(drive) != drive->select && present == 0) {
397 if (drive->dn & 1) { 397 if (drive->dn & 1) {
398 /* exit with drive0 selected */ 398 /* exit with drive0 selected */
399 SELECT_DRIVE(hwif->devices[0]); 399 tp_ops->dev_select(hwif->devices[0]);
400 /* allow ATA_BUSY to assert & clear */ 400 /* allow ATA_BUSY to assert & clear */
401 msleep(50); 401 msleep(50);
402 } 402 }
@@ -422,7 +422,7 @@ static int do_probe (ide_drive_t *drive, u8 cmd)
422 printk(KERN_ERR "%s: no response (status = 0x%02x), " 422 printk(KERN_ERR "%s: no response (status = 0x%02x), "
423 "resetting drive\n", drive->name, stat); 423 "resetting drive\n", drive->name, stat);
424 msleep(50); 424 msleep(50);
425 SELECT_DRIVE(drive); 425 tp_ops->dev_select(drive);
426 msleep(50); 426 msleep(50);
427 tp_ops->exec_command(hwif, ATA_CMD_DEV_RESET); 427 tp_ops->exec_command(hwif, ATA_CMD_DEV_RESET);
428 (void)ide_busy_sleep(hwif, WAIT_WORSTCASE, 0); 428 (void)ide_busy_sleep(hwif, WAIT_WORSTCASE, 0);
@@ -441,7 +441,7 @@ static int do_probe (ide_drive_t *drive, u8 cmd)
441 } 441 }
442 if (drive->dn & 1) { 442 if (drive->dn & 1) {
443 /* exit with drive0 selected */ 443 /* exit with drive0 selected */
444 SELECT_DRIVE(hwif->devices[0]); 444 tp_ops->dev_select(hwif->devices[0]);
445 msleep(50); 445 msleep(50);
446 /* ensure drive irq is clear */ 446 /* ensure drive irq is clear */
447 (void)tp_ops->read_status(hwif); 447 (void)tp_ops->read_status(hwif);
@@ -605,6 +605,7 @@ out:
605 605
606static int ide_port_wait_ready(ide_hwif_t *hwif) 606static int ide_port_wait_ready(ide_hwif_t *hwif)
607{ 607{
608 const struct ide_tp_ops *tp_ops = hwif->tp_ops;
608 ide_drive_t *drive; 609 ide_drive_t *drive;
609 int i, rc; 610 int i, rc;
610 611
@@ -627,8 +628,8 @@ static int ide_port_wait_ready(ide_hwif_t *hwif)
627 /* Ignore disks that we will not probe for later. */ 628 /* Ignore disks that we will not probe for later. */
628 if ((drive->dev_flags & IDE_DFLAG_NOPROBE) == 0 || 629 if ((drive->dev_flags & IDE_DFLAG_NOPROBE) == 0 ||
629 (drive->dev_flags & IDE_DFLAG_PRESENT)) { 630 (drive->dev_flags & IDE_DFLAG_PRESENT)) {
630 SELECT_DRIVE(drive); 631 tp_ops->dev_select(drive);
631 hwif->tp_ops->write_devctl(hwif, ATA_DEVCTL_OBS); 632 tp_ops->write_devctl(hwif, ATA_DEVCTL_OBS);
632 mdelay(2); 633 mdelay(2);
633 rc = ide_wait_not_busy(hwif, 35000); 634 rc = ide_wait_not_busy(hwif, 35000);
634 if (rc) 635 if (rc)
@@ -640,7 +641,7 @@ static int ide_port_wait_ready(ide_hwif_t *hwif)
640out: 641out:
641 /* Exit function with master reselected (let's be sane) */ 642 /* Exit function with master reselected (let's be sane) */
642 if (i) 643 if (i)
643 SELECT_DRIVE(hwif->devices[0]); 644 tp_ops->dev_select(hwif->devices[0]);
644 645
645 return rc; 646 return rc;
646} 647}
diff --git a/drivers/ide/ns87415.c b/drivers/ide/ns87415.c
index af1b421eb450..71a39fb3856f 100644
--- a/drivers/ide/ns87415.c
+++ b/drivers/ide/ns87415.c
@@ -262,7 +262,7 @@ static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif)
262#ifdef __sparc_v9__ 262#ifdef __sparc_v9__
263 /* 263 /*
264 * XXX: Reset the device, if we don't it will not respond to 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 timeout = 10000; 267 timeout = 10000;
268 outb(12, hwif->io_ports.ctl_addr); 268 outb(12, hwif->io_ports.ctl_addr);
diff --git a/include/linux/ide.h b/include/linux/ide.h
index c69181c61fd8..a5d26f66ef78 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1176,7 +1176,6 @@ void ide_tf_read(ide_drive_t *, struct ide_cmd *);
1176void ide_input_data(ide_drive_t *, struct ide_cmd *, void *, unsigned int); 1176void ide_input_data(ide_drive_t *, struct ide_cmd *, void *, unsigned int);
1177void ide_output_data(ide_drive_t *, struct ide_cmd *, void *, unsigned int); 1177void ide_output_data(ide_drive_t *, struct ide_cmd *, void *, unsigned int);
1178 1178
1179extern void SELECT_DRIVE(ide_drive_t *);
1180void SELECT_MASK(ide_drive_t *, int); 1179void SELECT_MASK(ide_drive_t *, int);
1181 1180
1182u8 ide_read_error(ide_drive_t *); 1181u8 ide_read_error(ide_drive_t *);