Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105021
b: refs/heads/master
c: e0d0020
h: refs/heads/master
i:
  105019: baba7f8
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Jul 23, 2008
1 parent f616ad4 commit 7418234
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 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: 6f904d015262dfa43eb1cecc00b0998b4c3543f2
refs/heads/master: e0d0020788543febd10ab933bde0fa181b627f4f
38 changes: 18 additions & 20 deletions trunk/drivers/ide/ide-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1574,19 +1574,16 @@ int ide_host_register(struct ide_host *host, const struct ide_port_info *d,
hw_regs_t **hws)
{
ide_hwif_t *hwif, *mate = NULL;
u8 idx[MAX_HWIFS];
int i, rc = 0;
int i, j = 0;

for (i = 0; i < MAX_HWIFS; i++) {
idx[i] = host->ports[i] ? host->ports[i]->index : 0xff;
hwif = host->ports[i];

if (idx[i] == 0xff) {
if (hwif == NULL) {
mate = NULL;
continue;
}

hwif = &ide_hwifs[idx[i]];

ide_init_port_hw(hwif, hws[i]);
ide_port_apply_params(hwif);

Expand All @@ -1608,10 +1605,10 @@ int ide_host_register(struct ide_host *host, const struct ide_port_info *d,
}

for (i = 0; i < MAX_HWIFS; i++) {
if (idx[i] == 0xff)
continue;
hwif = host->ports[i];

hwif = &ide_hwifs[idx[i]];
if (hwif == NULL)
continue;

if (ide_probe_port(hwif) == 0)
hwif->present = 1;
Expand All @@ -1625,19 +1622,20 @@ int ide_host_register(struct ide_host *host, const struct ide_port_info *d,
}

for (i = 0; i < MAX_HWIFS; i++) {
if (idx[i] == 0xff)
continue;
hwif = host->ports[i];

hwif = &ide_hwifs[idx[i]];
if (hwif == NULL)
continue;

if (hwif_init(hwif) == 0) {
printk(KERN_INFO "%s: failed to initialize IDE "
"interface\n", hwif->name);
hwif->present = 0;
rc = -1;
continue;
}

j++;

if (hwif->present)
ide_port_setup_devices(hwif);

Expand All @@ -1648,10 +1646,10 @@ int ide_host_register(struct ide_host *host, const struct ide_port_info *d,
}

for (i = 0; i < MAX_HWIFS; i++) {
if (idx[i] == 0xff)
continue;
hwif = host->ports[i];

hwif = &ide_hwifs[idx[i]];
if (hwif == NULL)
continue;

if (hwif->chipset == ide_unknown)
hwif->chipset = ide_generic;
Expand All @@ -1661,10 +1659,10 @@ int ide_host_register(struct ide_host *host, const struct ide_port_info *d,
}

for (i = 0; i < MAX_HWIFS; i++) {
if (idx[i] == 0xff)
continue;
hwif = host->ports[i];

hwif = &ide_hwifs[idx[i]];
if (hwif == NULL)
continue;

ide_sysfs_register_port(hwif);
ide_proc_register_port(hwif);
Expand All @@ -1673,7 +1671,7 @@ int ide_host_register(struct ide_host *host, const struct ide_port_info *d,
ide_proc_port_register_devices(hwif);
}

return rc;
return j ? 0 : -1;
}
EXPORT_SYMBOL_GPL(ide_host_register);

Expand Down

0 comments on commit 7418234

Please sign in to comment.