Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93548
b: refs/heads/master
c: 7daf66d
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Apr 26, 2008
1 parent bbb136c commit c269d0c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 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: 2e4ed2955d0de73cd43793ff495ea027e9fd2f44
refs/heads/master: 7daf66dd142b1978bf8670d9d959d835de37476f
25 changes: 15 additions & 10 deletions trunk/drivers/ide/legacy/qd65xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ static int __init qd_probe(int base)
config = inb(QD_CONFIG_PORT);

if (! ((config & QD_CONFIG_BASEPORT) >> 1 == (base == 0xb0)) )
return 1;
return -ENODEV;

unit = ! (config & QD_CONFIG_IDE_BASEPORT);

Expand All @@ -373,7 +373,8 @@ static int __init qd_probe(int base)

if ((config & 0xf0) == QD_CONFIG_QD6500) {

if (qd_testreg(base)) return 1; /* bad register */
if (qd_testreg(base))
return -ENODEV; /* bad register */

/* qd6500 found */

Expand All @@ -384,7 +385,7 @@ static int __init qd_probe(int base)

if (config & QD_CONFIG_DISABLED) {
printk(KERN_WARNING "qd6500 is disabled !\n");
return 1;
return -ENODEV;
}

ide_init_port_hw(hwif, &hw[unit]);
Expand All @@ -406,8 +407,8 @@ static int __init qd_probe(int base)

u8 control;

if (qd_testreg(base) || qd_testreg(base+0x02)) return 1;
/* bad registers */
if (qd_testreg(base) || qd_testreg(base + 0x02))
return -ENODEV; /* bad registers */

/* qd6580 found */

Expand Down Expand Up @@ -469,7 +470,7 @@ static int __init qd_probe(int base)
}
}
/* no qd65xx found */
return 1;
return -ENODEV;
}

int probe_qd65xx = 0;
Expand All @@ -479,14 +480,18 @@ MODULE_PARM_DESC(probe, "probe for QD65xx chipsets");

static int __init qd65xx_init(void)
{
int rc1, rc2 = -ENODEV;

if (probe_qd65xx == 0)
return -ENODEV;

if (qd_probe(0x30))
qd_probe(0xb0);
if (ide_hwifs[0].chipset != ide_qd65xx &&
ide_hwifs[1].chipset != ide_qd65xx)
rc1 = qd_probe(0x30);
if (rc1)
rc2 = qd_probe(0xb0);

if (rc1 < 0 && rc2 < 0)
return -ENODEV;

return 0;
}

Expand Down

0 comments on commit c269d0c

Please sign in to comment.