aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-proc.c')
-rw-r--r--drivers/ide/ide-proc.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c
index bab88ca7f7ec..edd7f186dc4d 100644
--- a/drivers/ide/ide-proc.c
+++ b/drivers/ide/ide-proc.c
@@ -46,9 +46,6 @@ static int proc_ide_read_imodel
46 int len; 46 int len;
47 const char *name; 47 const char *name;
48 48
49 /*
50 * Neither ide_unknown nor ide_forced should be set at this point.
51 */
52 switch (hwif->chipset) { 49 switch (hwif->chipset) {
53 case ide_generic: name = "generic"; break; 50 case ide_generic: name = "generic"; break;
54 case ide_pci: name = "pci"; break; 51 case ide_pci: name = "pci"; break;
@@ -764,27 +761,16 @@ void ide_proc_port_register_devices(ide_hwif_t *hwif)
764 } 761 }
765} 762}
766 763
767static void destroy_proc_ide_device(ide_hwif_t *hwif, ide_drive_t *drive) 764void ide_proc_unregister_device(ide_drive_t *drive)
768{ 765{
769 if (drive->proc) { 766 if (drive->proc) {
770 ide_remove_proc_entries(drive->proc, generic_drive_entries); 767 ide_remove_proc_entries(drive->proc, generic_drive_entries);
771 remove_proc_entry(drive->name, proc_ide_root); 768 remove_proc_entry(drive->name, proc_ide_root);
772 remove_proc_entry(drive->name, hwif->proc); 769 remove_proc_entry(drive->name, drive->hwif->proc);
773 drive->proc = NULL; 770 drive->proc = NULL;
774 } 771 }
775} 772}
776 773
777static void destroy_proc_ide_drives(ide_hwif_t *hwif)
778{
779 int d;
780
781 for (d = 0; d < MAX_DRIVES; d++) {
782 ide_drive_t *drive = &hwif->drives[d];
783 if (drive->proc)
784 destroy_proc_ide_device(hwif, drive);
785 }
786}
787
788static ide_proc_entry_t hwif_entries[] = { 774static ide_proc_entry_t hwif_entries[] = {
789 { "channel", S_IFREG|S_IRUGO, proc_ide_read_channel, NULL }, 775 { "channel", S_IFREG|S_IRUGO, proc_ide_read_channel, NULL },
790 { "mate", S_IFREG|S_IRUGO, proc_ide_read_mate, NULL }, 776 { "mate", S_IFREG|S_IRUGO, proc_ide_read_mate, NULL },
@@ -816,7 +802,6 @@ EXPORT_SYMBOL_GPL(ide_pci_create_host_proc);
816void ide_proc_unregister_port(ide_hwif_t *hwif) 802void ide_proc_unregister_port(ide_hwif_t *hwif)
817{ 803{
818 if (hwif->proc) { 804 if (hwif->proc) {
819 destroy_proc_ide_drives(hwif);
820 ide_remove_proc_entries(hwif->proc, hwif_entries); 805 ide_remove_proc_entries(hwif->proc, hwif_entries);
821 remove_proc_entry(hwif->name, proc_ide_root); 806 remove_proc_entry(hwif->name, proc_ide_root);
822 hwif->proc = NULL; 807 hwif->proc = NULL;