Commit a25e0bcd authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by James Bottomley

[PATCH] create /proc/ide/hdX/capacity only once

In ide_register_subdriver() create drive->proc entries only if driver is
not idedefault_driver.

[ There won't be /proc/ide/hdX/capacity for devices attached
  to idedefault_driver now, it reported 0x7fffffff previously. ]

Do not create drive->proc entries in create_proc_ide_drives(), they are
added later in ide_register_subdriver().
parent 75e306e3
...@@ -712,7 +712,6 @@ void create_proc_ide_drives(ide_hwif_t *hwif) ...@@ -712,7 +712,6 @@ void create_proc_ide_drives(ide_hwif_t *hwif)
for (d = 0; d < MAX_DRIVES; d++) { for (d = 0; d < MAX_DRIVES; d++) {
ide_drive_t *drive = &hwif->drives[d]; ide_drive_t *drive = &hwif->drives[d];
ide_driver_t *driver = drive->driver;
if (!drive->present) if (!drive->present)
continue; continue;
...@@ -720,13 +719,8 @@ void create_proc_ide_drives(ide_hwif_t *hwif) ...@@ -720,13 +719,8 @@ void create_proc_ide_drives(ide_hwif_t *hwif)
continue; continue;
drive->proc = proc_mkdir(drive->name, parent); drive->proc = proc_mkdir(drive->name, parent);
if (drive->proc) { if (drive->proc)
ide_add_proc_entries(drive->proc, generic_drive_entries, drive); ide_add_proc_entries(drive->proc, generic_drive_entries, drive);
if (driver) {
ide_add_proc_entries(drive->proc, generic_subdriver_entries, drive);
ide_add_proc_entries(drive->proc, driver->proc, drive);
}
}
sprintf(name,"ide%d/%s", (drive->name[2]-'a')/2, drive->name); sprintf(name,"ide%d/%s", (drive->name[2]-'a')/2, drive->name);
ent = proc_symlink(drive->name, proc_ide_root, name); ent = proc_symlink(drive->name, proc_ide_root, name);
if (!ent) return; if (!ent) return;
......
...@@ -2349,8 +2349,10 @@ int ide_register_subdriver (ide_drive_t *drive, ide_driver_t *driver, int versio ...@@ -2349,8 +2349,10 @@ int ide_register_subdriver (ide_drive_t *drive, ide_driver_t *driver, int versio
} }
drive->suspend_reset = 0; drive->suspend_reset = 0;
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
ide_add_proc_entries(drive->proc, generic_subdriver_entries, drive); if (drive->driver != &idedefault_driver) {
ide_add_proc_entries(drive->proc, driver->proc, drive); ide_add_proc_entries(drive->proc, generic_subdriver_entries, drive);
ide_add_proc_entries(drive->proc, driver->proc, drive);
}
#endif #endif
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment