Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93629
b: refs/heads/master
c: 7a2199f
h: refs/heads/master
i:
  93627: 62b31b0
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Apr 26, 2008
1 parent 9d5e836 commit 62fa60b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 36 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: 0bfeee7d4190938291a76536c7f6cd8f4e2dc30c
refs/heads/master: 7a2199f341edb2515021ccd6fe122c0d15b08fc7
52 changes: 17 additions & 35 deletions trunk/drivers/ide/legacy/qd65xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ static const struct ide_port_info qd65xx_port_info __initdata = {
static int __init qd_probe(int base)
{
int rc;
u8 config, unit;
u8 config, unit, control;
struct ide_port_info d = qd65xx_port_info;

config = inb(QD_CONFIG_PORT);
Expand All @@ -347,13 +347,11 @@ static int __init qd_probe(int base)
if (unit)
d.host_flags |= IDE_HFLAG_QD_2ND_PORT;

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

switch (config & 0xf0) {
case QD_CONFIG_QD6500:
if (qd_testreg(base))
return -ENODEV; /* bad register */

/* qd6500 found */

if (config & QD_CONFIG_DISABLED) {
printk(KERN_WARNING "qd6500 is disabled !\n");
return -ENODEV;
Expand All @@ -365,22 +363,12 @@ static int __init qd_probe(int base)

d.port_ops = &qd6500_port_ops;
d.host_flags |= IDE_HFLAG_SINGLE;

rc = ide_legacy_device_add(&d, (base << 8) | config);

return (rc == 0) ? 1 : rc;
}

if (((config & 0xf0) == QD_CONFIG_QD6580_A) ||
((config & 0xf0) == QD_CONFIG_QD6580_B)) {

u8 control;

break;
case QD_CONFIG_QD6580_A:
case QD_CONFIG_QD6580_B:
if (qd_testreg(base) || qd_testreg(base + 0x02))
return -ENODEV; /* bad registers */

/* qd6580 found */

control = inb(QD_CONTROL_PORT);

printk(KERN_NOTICE "qd6580 at %#x\n", base);
Expand All @@ -390,28 +378,22 @@ static int __init qd_probe(int base)
outb(QD_DEF_CONTR, QD_CONTROL_PORT);

d.port_ops = &qd6580_port_ops;

if (control & QD_CONTR_SEC_DISABLED) {
/* secondary disabled */

printk(KERN_INFO "qd6580: single IDE board\n");

if (control & QD_CONTR_SEC_DISABLED)
d.host_flags |= IDE_HFLAG_SINGLE;

rc = ide_legacy_device_add(&d, (base << 8) | config);
printk(KERN_INFO "qd6580: %s IDE board\n",
(control & QD_CONTR_SEC_DISABLED) ? "single" : "dual");
break;
default:
return -ENODEV;
}

return (rc == 0) ? 1 : rc;
} else {
/* secondary enabled */
printk(KERN_INFO "qd6580: dual IDE board\n");
rc = ide_legacy_device_add(&d, (base << 8) | config);

rc = ide_legacy_device_add(&d, (base << 8) | config);
if (d.host_flags & IDE_HFLAG_SINGLE)
return (rc == 0) ? 1 : rc;

return rc; /* no other qd65xx possible */
}
}
/* no qd65xx found */
return -ENODEV;
return rc;
}

int probe_qd65xx = 0;
Expand Down

0 comments on commit 62fa60b

Please sign in to comment.