Skip to content

Commit

Permalink
ide: Fix ordering of procfs registry.
Browse files Browse the repository at this point in the history
We must ensure that ide_proc_port_register_devices() occurs on an
interface before ide_proc_register_driver() executes for that
interfaces drives.

Therefore defer the registry of the driver device objects backed by
ide_bus_type until after ide_proc_port_register_devices() has run
and thus all of the drive->proc procfs directory pointers have been
setup.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Wolfram Sang authored and David S. Miller committed Sep 14, 2010
1 parent cd078af commit dbee032
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions drivers/ide/ide-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1444,23 +1444,17 @@ int ide_host_register(struct ide_host *host, const struct ide_port_info *d,
ide_acpi_port_init_devices(hwif);
}

ide_host_for_each_port(i, hwif, host) {
if (hwif == NULL)
continue;

if (hwif->present)
hwif_register_devices(hwif);
}

ide_host_for_each_port(i, hwif, host) {
if (hwif == NULL)
continue;

ide_sysfs_register_port(hwif);
ide_proc_register_port(hwif);

if (hwif->present)
if (hwif->present) {
ide_proc_port_register_devices(hwif);
hwif_register_devices(hwif);
}
}

return j ? 0 : -1;
Expand Down

0 comments on commit dbee032

Please sign in to comment.