Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 71769
b: refs/heads/master
c: f949820
h: refs/heads/master
i:
  71767: ca525ff
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Oct 19, 2007
1 parent 78341bc commit 9934131
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a34a8751f312bd4674d48d63556efa8f0e3a1021
refs/heads/master: f949820de30b6fd0eb958f7eea87dac190de1cec
17 changes: 9 additions & 8 deletions trunk/drivers/ide/legacy/qd65xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,25 @@

static int timings[4]={-1,-1,-1,-1}; /* stores current timing for each timer */

static DEFINE_SPINLOCK(qd65xx_lock);

static void qd_write_reg (u8 content, unsigned long reg)
{
unsigned long flags;

spin_lock_irqsave(&ide_lock, flags);
spin_lock_irqsave(&qd65xx_lock, flags);
outb(content,reg);
spin_unlock_irqrestore(&ide_lock, flags);
spin_unlock_irqrestore(&qd65xx_lock, flags);
}

static u8 __init qd_read_reg (unsigned long reg)
{
unsigned long flags;
u8 read;

spin_lock_irqsave(&ide_lock, flags);
spin_lock_irqsave(&qd65xx_lock, flags);
read = inb(reg);
spin_unlock_irqrestore(&ide_lock, flags);
spin_unlock_irqrestore(&qd65xx_lock, flags);
return read;
}

Expand Down Expand Up @@ -301,16 +303,15 @@ static void qd6580_set_pio_mode(ide_drive_t *drive, const u8 pio)

static int __init qd_testreg(int port)
{
u8 savereg;
u8 readreg;
unsigned long flags;
u8 savereg, readreg;

spin_lock_irqsave(&ide_lock, flags);
spin_lock_irqsave(&qd65xx_lock, flags);
savereg = inb_p(port);
outb_p(QD_TESTVAL, port); /* safe value */
readreg = inb_p(port);
outb(savereg, port);
spin_unlock_irqrestore(&ide_lock, flags);
spin_unlock_irqrestore(&qd65xx_lock, flags);

if (savereg == QD_TESTVAL) {
printk(KERN_ERR "Outch ! the probe for qd65xx isn't reliable !\n");
Expand Down

0 comments on commit 9934131

Please sign in to comment.