diff options
Diffstat (limited to 'drivers/ide/ide-proc.c')
-rw-r--r-- | drivers/ide/ide-proc.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c index 949a6f609d84..d50bd996ff22 100644 --- a/drivers/ide/ide-proc.c +++ b/drivers/ide/ide-proc.c | |||
@@ -39,6 +39,8 @@ | |||
39 | 39 | ||
40 | #include <asm/io.h> | 40 | #include <asm/io.h> |
41 | 41 | ||
42 | static struct proc_dir_entry *proc_ide_root; | ||
43 | |||
42 | static int proc_ide_read_imodel | 44 | static int proc_ide_read_imodel |
43 | (char *page, char **start, off_t off, int count, int *eof, void *data) | 45 | (char *page, char **start, off_t off, int count, int *eof, void *data) |
44 | { | 46 | { |
@@ -783,26 +785,24 @@ static ide_proc_entry_t hwif_entries[] = { | |||
783 | { NULL, 0, NULL, NULL } | 785 | { NULL, 0, NULL, NULL } |
784 | }; | 786 | }; |
785 | 787 | ||
786 | void create_proc_ide_interfaces(void) | 788 | void ide_proc_register_port(ide_hwif_t *hwif) |
787 | { | 789 | { |
788 | int h; | 790 | if (!hwif->present) |
791 | return; | ||
789 | 792 | ||
790 | for (h = 0; h < MAX_HWIFS; h++) { | 793 | if (!hwif->proc) { |
791 | ide_hwif_t *hwif = &ide_hwifs[h]; | 794 | hwif->proc = proc_mkdir(hwif->name, proc_ide_root); |
792 | 795 | ||
793 | if (!hwif->present) | 796 | if (!hwif->proc) |
794 | continue; | 797 | return; |
795 | if (!hwif->proc) { | 798 | |
796 | hwif->proc = proc_mkdir(hwif->name, proc_ide_root); | 799 | ide_add_proc_entries(hwif->proc, hwif_entries, hwif); |
797 | if (!hwif->proc) | ||
798 | return; | ||
799 | ide_add_proc_entries(hwif->proc, hwif_entries, hwif); | ||
800 | } | ||
801 | create_proc_ide_drives(hwif); | ||
802 | } | 800 | } |
801 | |||
802 | create_proc_ide_drives(hwif); | ||
803 | } | 803 | } |
804 | 804 | ||
805 | EXPORT_SYMBOL(create_proc_ide_interfaces); | 805 | EXPORT_SYMBOL_GPL(ide_proc_register_port); |
806 | 806 | ||
807 | #ifdef CONFIG_BLK_DEV_IDEPCI | 807 | #ifdef CONFIG_BLK_DEV_IDEPCI |
808 | void ide_pci_create_host_proc(const char *name, get_info_t *get_info) | 808 | void ide_pci_create_host_proc(const char *name, get_info_t *get_info) |
@@ -813,7 +813,7 @@ void ide_pci_create_host_proc(const char *name, get_info_t *get_info) | |||
813 | EXPORT_SYMBOL_GPL(ide_pci_create_host_proc); | 813 | EXPORT_SYMBOL_GPL(ide_pci_create_host_proc); |
814 | #endif | 814 | #endif |
815 | 815 | ||
816 | void destroy_proc_ide_interface(ide_hwif_t *hwif) | 816 | void ide_proc_unregister_port(ide_hwif_t *hwif) |
817 | { | 817 | { |
818 | if (hwif->proc) { | 818 | if (hwif->proc) { |
819 | destroy_proc_ide_drives(hwif); | 819 | destroy_proc_ide_drives(hwif); |
@@ -860,11 +860,11 @@ void proc_ide_create(void) | |||
860 | { | 860 | { |
861 | struct proc_dir_entry *entry; | 861 | struct proc_dir_entry *entry; |
862 | 862 | ||
863 | proc_ide_root = proc_mkdir("ide", NULL); | ||
864 | |||
863 | if (!proc_ide_root) | 865 | if (!proc_ide_root) |
864 | return; | 866 | return; |
865 | 867 | ||
866 | create_proc_ide_interfaces(); | ||
867 | |||
868 | entry = create_proc_entry("drivers", 0, proc_ide_root); | 868 | entry = create_proc_entry("drivers", 0, proc_ide_root); |
869 | if (entry) | 869 | if (entry) |
870 | entry->proc_fops = &ide_drivers_operations; | 870 | entry->proc_fops = &ide_drivers_operations; |