aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-park.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-01-06 11:20:50 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-01-06 11:20:50 -0500
commitb65fac32cfe3b2f98cd472fef400bd1c1340de23 (patch)
tree493a7e30e23e5413a9e5ad6102b8e91ebc02c069 /drivers/ide/ide-park.c
parent5b31f855f10d0053e738baa6d91fb6a3fad35119 (diff)
ide: merge ide_hwgroup_t with ide_hwif_t (v2)
* Merge ide_hwgroup_t with ide_hwif_t. * Cleanup init_irq() accordingly, then remove no longer needed ide_remove_port_from_hwgroup() and ide_ports[]. * Remove now unused HWGROUP() macro. While at it: * ide_dump_ata_error() fixups v2: * Fix ->quirk_list check in do_ide_request() (s/hwif->cur_dev/prev_port->cur_dev). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-park.c')
-rw-r--r--drivers/ide/ide-park.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/ide/ide-park.c b/drivers/ide/ide-park.c
index 678454ac2483..c875a957596c 100644
--- a/drivers/ide/ide-park.c
+++ b/drivers/ide/ide-park.c
@@ -7,22 +7,22 @@ DECLARE_WAIT_QUEUE_HEAD(ide_park_wq);
7 7
8static void issue_park_cmd(ide_drive_t *drive, unsigned long timeout) 8static void issue_park_cmd(ide_drive_t *drive, unsigned long timeout)
9{ 9{
10 ide_hwgroup_t *hwgroup = drive->hwif->hwgroup; 10 ide_hwif_t *hwif = drive->hwif;
11 struct request_queue *q = drive->queue; 11 struct request_queue *q = drive->queue;
12 struct request *rq; 12 struct request *rq;
13 int rc; 13 int rc;
14 14
15 timeout += jiffies; 15 timeout += jiffies;
16 spin_lock_irq(&hwgroup->lock); 16 spin_lock_irq(&hwif->lock);
17 if (drive->dev_flags & IDE_DFLAG_PARKED) { 17 if (drive->dev_flags & IDE_DFLAG_PARKED) {
18 int reset_timer = time_before(timeout, drive->sleep); 18 int reset_timer = time_before(timeout, drive->sleep);
19 int start_queue = 0; 19 int start_queue = 0;
20 20
21 drive->sleep = timeout; 21 drive->sleep = timeout;
22 wake_up_all(&ide_park_wq); 22 wake_up_all(&ide_park_wq);
23 if (reset_timer && del_timer(&hwgroup->timer)) 23 if (reset_timer && del_timer(&hwif->timer))
24 start_queue = 1; 24 start_queue = 1;
25 spin_unlock_irq(&hwgroup->lock); 25 spin_unlock_irq(&hwif->lock);
26 26
27 if (start_queue) { 27 if (start_queue) {
28 spin_lock_irq(q->queue_lock); 28 spin_lock_irq(q->queue_lock);
@@ -31,7 +31,7 @@ static void issue_park_cmd(ide_drive_t *drive, unsigned long timeout)
31 } 31 }
32 return; 32 return;
33 } 33 }
34 spin_unlock_irq(&hwgroup->lock); 34 spin_unlock_irq(&hwif->lock);
35 35
36 rq = blk_get_request(q, READ, __GFP_WAIT); 36 rq = blk_get_request(q, READ, __GFP_WAIT);
37 rq->cmd[0] = REQ_PARK_HEADS; 37 rq->cmd[0] = REQ_PARK_HEADS;
@@ -64,21 +64,21 @@ ssize_t ide_park_show(struct device *dev, struct device_attribute *attr,
64 char *buf) 64 char *buf)
65{ 65{
66 ide_drive_t *drive = to_ide_device(dev); 66 ide_drive_t *drive = to_ide_device(dev);
67 ide_hwgroup_t *hwgroup = drive->hwif->hwgroup; 67 ide_hwif_t *hwif = drive->hwif;
68 unsigned long now; 68 unsigned long now;
69 unsigned int msecs; 69 unsigned int msecs;
70 70
71 if (drive->dev_flags & IDE_DFLAG_NO_UNLOAD) 71 if (drive->dev_flags & IDE_DFLAG_NO_UNLOAD)
72 return -EOPNOTSUPP; 72 return -EOPNOTSUPP;
73 73
74 spin_lock_irq(&hwgroup->lock); 74 spin_lock_irq(&hwif->lock);
75 now = jiffies; 75 now = jiffies;
76 if (drive->dev_flags & IDE_DFLAG_PARKED && 76 if (drive->dev_flags & IDE_DFLAG_PARKED &&
77 time_after(drive->sleep, now)) 77 time_after(drive->sleep, now))
78 msecs = jiffies_to_msecs(drive->sleep - now); 78 msecs = jiffies_to_msecs(drive->sleep - now);
79 else 79 else
80 msecs = 0; 80 msecs = 0;
81 spin_unlock_irq(&hwgroup->lock); 81 spin_unlock_irq(&hwif->lock);
82 82
83 return snprintf(buf, 20, "%u\n", msecs); 83 return snprintf(buf, 20, "%u\n", msecs);
84} 84}