[ide] remove hwif from /proc/ide/ as part of ide_unregister_hwif()

Original patch from Mark Lord <lkml@rtr.ca>.
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 15b4b406
...@@ -418,7 +418,7 @@ static void destroy_proc_ide_device(ide_hwif_t *hwif, ide_drive_t *drive) ...@@ -418,7 +418,7 @@ static void destroy_proc_ide_device(ide_hwif_t *hwif, ide_drive_t *drive)
} }
} }
void destroy_proc_ide_drives(ide_hwif_t *hwif) static void destroy_proc_ide_drives(ide_hwif_t *hwif)
{ {
int d; int d;
...@@ -466,24 +466,27 @@ void ide_pci_create_host_proc(const char *name, get_info_t *get_info) ...@@ -466,24 +466,27 @@ void ide_pci_create_host_proc(const char *name, get_info_t *get_info)
EXPORT_SYMBOL_GPL(ide_pci_create_host_proc); EXPORT_SYMBOL_GPL(ide_pci_create_host_proc);
#endif #endif
void destroy_proc_ide_interface(ide_hwif_t *hwif)
{
if (hwif->proc) {
destroy_proc_ide_drives(hwif);
ide_remove_proc_entries(hwif->proc, hwif_entries);
remove_proc_entry(hwif->name, proc_ide_root);
hwif->proc = NULL;
}
}
void destroy_proc_ide_interfaces(void) void destroy_proc_ide_interfaces(void)
{ {
int h; int h;
for (h = 0; h < MAX_HWIFS; h++) { for (h = 0; h < MAX_HWIFS; h++) {
ide_hwif_t *hwif = &ide_hwifs[h]; ide_hwif_t *hwif = &ide_hwifs[h];
int exist = (hwif->proc != NULL);
#if 0 #if 0
if (!hwif->present) if (!hwif->present)
continue; continue;
#endif #endif
if (exist) { destroy_proc_ide_interface(hwif);
destroy_proc_ide_drives(hwif);
ide_remove_proc_entries(hwif->proc, hwif_entries);
remove_proc_entry(hwif->name, proc_ide_root);
hwif->proc = NULL;
} else
continue;
} }
} }
......
...@@ -796,9 +796,7 @@ void ide_unregister(unsigned int index) ...@@ -796,9 +796,7 @@ void ide_unregister(unsigned int index)
DRIVER(drive)->cleanup(drive); DRIVER(drive)->cleanup(drive);
} }
#ifdef CONFIG_PROC_FS destroy_proc_ide_interface(hwif);
destroy_proc_ide_drives(hwif);
#endif
hwgroup = hwif->hwgroup; hwgroup = hwif->hwgroup;
/* /*
......
...@@ -1045,8 +1045,8 @@ extern struct proc_dir_entry *proc_ide_root; ...@@ -1045,8 +1045,8 @@ extern struct proc_dir_entry *proc_ide_root;
extern void proc_ide_create(void); extern void proc_ide_create(void);
extern void proc_ide_destroy(void); extern void proc_ide_destroy(void);
extern void destroy_proc_ide_drives(ide_hwif_t *);
extern void create_proc_ide_interfaces(void); extern void create_proc_ide_interfaces(void);
void destroy_proc_ide_interface(ide_hwif_t *);
extern void ide_add_proc_entries(struct proc_dir_entry *, ide_proc_entry_t *, void *); extern void ide_add_proc_entries(struct proc_dir_entry *, ide_proc_entry_t *, void *);
extern void ide_remove_proc_entries(struct proc_dir_entry *, ide_proc_entry_t *); extern void ide_remove_proc_entries(struct proc_dir_entry *, ide_proc_entry_t *);
read_proc_t proc_ide_read_capacity; read_proc_t proc_ide_read_capacity;
...@@ -1073,6 +1073,7 @@ void ide_pci_create_host_proc(const char *, get_info_t *); ...@@ -1073,6 +1073,7 @@ void ide_pci_create_host_proc(const char *, get_info_t *);
} }
#else #else
static inline void create_proc_ide_interfaces(void) { ; } static inline void create_proc_ide_interfaces(void) { ; }
static inline void destroy_proc_ide_interface(ide_hwif_t *hwif) { ; }
#define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) return 0; #define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) return 0;
#endif #endif
......
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