]> err.no Git - linux-2.6/blobdiff - drivers/ide/ide-proc.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
[linux-2.6] / drivers / ide / ide-proc.c
index 949a6f609d8473231aab82b9b517ee8e48823933..ea94c9aa1220754b8cad352bff4cb8102e08075f 100644 (file)
@@ -39,6 +39,8 @@
 
 #include <asm/io.h>
 
+static struct proc_dir_entry *proc_ide_root;
+
 static int proc_ide_read_imodel
        (char *page, char **start, off_t off, int count, int *eof, void *data)
 {
@@ -65,6 +67,8 @@ static int proc_ide_read_imodel
                case ide_4drives:       name = "4drives";       break;
                case ide_pmac:          name = "mac-io";        break;
                case ide_au1xxx:        name = "au1xxx";        break;
+               case ide_etrax100:      name = "etrax100";      break;
+               case ide_acorn:         name = "acorn";         break;
                default:                name = "(unknown)";     break;
        }
        len = sprintf(page, "%s\n", name);
@@ -783,26 +787,24 @@ static ide_proc_entry_t hwif_entries[] = {
        { NULL, 0, NULL, NULL }
 };
 
-void create_proc_ide_interfaces(void)
+void ide_proc_register_port(ide_hwif_t *hwif)
 {
-       int     h;
+       if (!hwif->present)
+               return;
 
-       for (h = 0; h < MAX_HWIFS; h++) {
-               ide_hwif_t *hwif = &ide_hwifs[h];
+       if (!hwif->proc) {
+               hwif->proc = proc_mkdir(hwif->name, proc_ide_root);
 
-               if (!hwif->present)
-                       continue;
-               if (!hwif->proc) {
-                       hwif->proc = proc_mkdir(hwif->name, proc_ide_root);
-                       if (!hwif->proc)
-                               return;
-                       ide_add_proc_entries(hwif->proc, hwif_entries, hwif);
-               }
-               create_proc_ide_drives(hwif);
+               if (!hwif->proc)
+                       return;
+
+               ide_add_proc_entries(hwif->proc, hwif_entries, hwif);
        }
+
+       create_proc_ide_drives(hwif);
 }
 
-EXPORT_SYMBOL(create_proc_ide_interfaces);
+EXPORT_SYMBOL_GPL(ide_proc_register_port);
 
 #ifdef CONFIG_BLK_DEV_IDEPCI
 void ide_pci_create_host_proc(const char *name, get_info_t *get_info)
@@ -813,7 +815,7 @@ void ide_pci_create_host_proc(const char *name, get_info_t *get_info)
 EXPORT_SYMBOL_GPL(ide_pci_create_host_proc);
 #endif
 
-void destroy_proc_ide_interface(ide_hwif_t *hwif)
+void ide_proc_unregister_port(ide_hwif_t *hwif)
 {
        if (hwif->proc) {
                destroy_proc_ide_drives(hwif);
@@ -860,11 +862,11 @@ void proc_ide_create(void)
 {
        struct proc_dir_entry *entry;
 
+       proc_ide_root = proc_mkdir("ide", NULL);
+
        if (!proc_ide_root)
                return;
 
-       create_proc_ide_interfaces();
-
        entry = create_proc_entry("drivers", 0, proc_ide_root);
        if (entry)
                entry->proc_fops = &ide_drivers_operations;