Commit 3c35893a authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Linus Torvalds

[PATCH] fix /proc/ide/<chipset> for IDE PCI modules

Make IDE PCI drivers register /proc/ide/<chipset> entries themselves.
parent c6141a61
...@@ -109,17 +109,6 @@ static int xx_xx_parse_error (const char *data, unsigned long len, const char *m ...@@ -109,17 +109,6 @@ static int xx_xx_parse_error (const char *data, unsigned long len, const char *m
return -EINVAL; return -EINVAL;
} }
static struct proc_dir_entry * proc_ide_root = NULL;
#ifdef CONFIG_BLK_DEV_IDEPCI
#include <linux/delay.h>
/*
* This is the list of registered PCI chipset driver data structures.
*/
static ide_pci_host_proc_t * ide_pci_host_proc_list;
#endif /* CONFIG_BLK_DEV_IDEPCI */
static int proc_ide_write_config static int proc_ide_write_config
(struct file *file, const char *buffer, unsigned long count, void *data) (struct file *file, const char *buffer, unsigned long count, void *data)
{ {
...@@ -787,27 +776,16 @@ void create_proc_ide_interfaces(void) ...@@ -787,27 +776,16 @@ void create_proc_ide_interfaces(void)
} }
} }
EXPORT_SYMBOL(create_proc_ide_interfaces);
#ifdef CONFIG_BLK_DEV_IDEPCI #ifdef CONFIG_BLK_DEV_IDEPCI
void ide_pci_register_host_proc (ide_pci_host_proc_t *p) void ide_pci_create_host_proc(const char *name, get_info_t *get_info)
{ {
ide_pci_host_proc_t *tmp; create_proc_info_entry(name, 0, proc_ide_root, get_info);
if (!p) return;
p->next = NULL;
p->set = 1;
if (ide_pci_host_proc_list) {
tmp = ide_pci_host_proc_list;
while (tmp->next) tmp = tmp->next;
tmp->next = p;
} else
ide_pci_host_proc_list = p;
} }
EXPORT_SYMBOL(ide_pci_register_host_proc); EXPORT_SYMBOL_GPL(ide_pci_create_host_proc);
#endif
#endif /* CONFIG_BLK_DEV_IDEPCI */
EXPORT_SYMBOL(create_proc_ide_interfaces);
void destroy_proc_ide_interfaces(void) void destroy_proc_ide_interfaces(void)
{ {
...@@ -846,45 +824,22 @@ static struct file_operations ide_drivers_operations = { ...@@ -846,45 +824,22 @@ static struct file_operations ide_drivers_operations = {
void proc_ide_create(void) void proc_ide_create(void)
{ {
#ifdef CONFIG_BLK_DEV_IDEPCI
ide_pci_host_proc_t *p = ide_pci_host_proc_list;
#endif /* CONFIG_BLK_DEV_IDEPCI */
struct proc_dir_entry *entry; struct proc_dir_entry *entry;
proc_ide_root = proc_mkdir("ide", 0);
if (!proc_ide_root) return; if (!proc_ide_root)
return;
create_proc_ide_interfaces(); create_proc_ide_interfaces();
entry = create_proc_entry("drivers", 0, proc_ide_root); entry = create_proc_entry("drivers", 0, proc_ide_root);
if (entry) if (entry)
entry->proc_fops = &ide_drivers_operations; entry->proc_fops = &ide_drivers_operations;
#ifdef CONFIG_BLK_DEV_IDEPCI
while (p != NULL)
{
if (p->name != NULL && p->set == 1 && p->get_info != NULL)
{
p->parent = proc_ide_root;
create_proc_info_entry(p->name, 0, p->parent, p->get_info);
p->set = 2;
}
p = p->next;
}
#endif /* CONFIG_BLK_DEV_IDEPCI */
} }
EXPORT_SYMBOL(proc_ide_create); EXPORT_SYMBOL(proc_ide_create);
void proc_ide_destroy(void) void proc_ide_destroy(void)
{ {
#ifdef CONFIG_BLK_DEV_IDEPCI
ide_pci_host_proc_t *p;
for (p = ide_pci_host_proc_list; p; p = p->next) {
if (p->set == 2)
remove_proc_entry(p->name, p->parent);
}
#endif /* CONFIG_BLK_DEV_IDEPCI */
remove_proc_entry("ide/drivers", proc_ide_root); remove_proc_entry("ide/drivers", proc_ide_root);
destroy_proc_ide_interfaces(); destroy_proc_ide_interfaces();
remove_proc_entry("ide", 0); remove_proc_entry("ide", 0);
......
...@@ -474,6 +474,8 @@ struct seq_operations ide_drivers_op = { ...@@ -474,6 +474,8 @@ struct seq_operations ide_drivers_op = {
}; };
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
struct proc_dir_entry *proc_ide_root;
ide_proc_entry_t generic_subdriver_entries[] = { ide_proc_entry_t generic_subdriver_entries[] = {
{ "capacity", S_IFREG|S_IRUGO, proc_ide_read_capacity, NULL }, { "capacity", S_IFREG|S_IRUGO, proc_ide_read_capacity, NULL },
{ NULL, 0, NULL, NULL } { NULL, 0, NULL, NULL }
...@@ -2402,6 +2404,10 @@ int __init ide_init (void) ...@@ -2402,6 +2404,10 @@ int __init ide_init (void)
init_ide_data(); init_ide_data();
#ifdef CONFIG_PROC_FS
proc_ide_root = proc_mkdir("ide", 0);
#endif
#ifdef CONFIG_BLK_DEV_ALI14XX #ifdef CONFIG_BLK_DEV_ALI14XX
if (probe_ali14xx) if (probe_ali14xx)
(void)ali14xx_init(); (void)ali14xx_init();
......
...@@ -423,7 +423,7 @@ static unsigned int __init init_chipset_aec62xx (struct pci_dev *dev, const char ...@@ -423,7 +423,7 @@ static unsigned int __init init_chipset_aec62xx (struct pci_dev *dev, const char
if (!aec62xx_proc) { if (!aec62xx_proc) {
aec62xx_proc = 1; aec62xx_proc = 1;
ide_pci_register_host_proc(&aec62xx_procs[0]); ide_pci_create_host_proc("aec62xx", aec62xx_get_info);
} }
#endif /* DISPLAY_AEC62XX_TIMINGS && CONFIG_PROC_FS */ #endif /* DISPLAY_AEC62XX_TIMINGS && CONFIG_PROC_FS */
......
...@@ -70,24 +70,6 @@ struct chipset_bus_clock_list_entry aec6xxx_34_base [] = { ...@@ -70,24 +70,6 @@ struct chipset_bus_clock_list_entry aec6xxx_34_base [] = {
#define BUSCLOCK(D) \ #define BUSCLOCK(D) \
((struct chipset_bus_clock_list_entry *) pci_get_drvdata((D))) ((struct chipset_bus_clock_list_entry *) pci_get_drvdata((D)))
#if defined(DISPLAY_AEC62XX_TIMINGS) && defined(CONFIG_PROC_FS)
#include <linux/stat.h>
#include <linux/proc_fs.h>
static u8 aec62xx_proc;
static int aec62xx_get_info(char *, char **, off_t, int);
static ide_pci_host_proc_t aec62xx_procs[] = {
{
.name = "aec62xx",
.set = 1,
.get_info = aec62xx_get_info,
.parent = NULL,
},
};
#endif /* DISPLAY_AEC62XX_TIMINGS && CONFIG_PROC_FS */
static void init_setup_aec6x80(struct pci_dev *, ide_pci_device_t *); static void init_setup_aec6x80(struct pci_dev *, ide_pci_device_t *);
static void init_setup_aec62xx(struct pci_dev *, ide_pci_device_t *); static void init_setup_aec62xx(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_aec62xx(struct pci_dev *, const char *); static unsigned int init_chipset_aec62xx(struct pci_dev *, const char *);
......
...@@ -588,7 +588,7 @@ static unsigned int __init init_chipset_ali15x3 (struct pci_dev *dev, const char ...@@ -588,7 +588,7 @@ static unsigned int __init init_chipset_ali15x3 (struct pci_dev *dev, const char
if (!ali_proc) { if (!ali_proc) {
ali_proc = 1; ali_proc = 1;
bmide_dev = dev; bmide_dev = dev;
ide_pci_register_host_proc(&ali_procs[0]); ide_pci_create_host_proc("ali", ali_get_info);
} }
#endif /* defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_PROC_FS) */ #endif /* defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_PROC_FS) */
......
...@@ -7,24 +7,6 @@ ...@@ -7,24 +7,6 @@
#define DISPLAY_ALI_TIMINGS #define DISPLAY_ALI_TIMINGS
#if defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_PROC_FS)
#include <linux/stat.h>
#include <linux/proc_fs.h>
static u8 ali_proc;
static int ali_get_info(char *, char **, off_t, int);
static ide_pci_host_proc_t ali_procs[] = {
{
.name = "ali",
.set = 1,
.get_info = ali_get_info,
.parent = NULL,
},
};
#endif /* DISPLAY_ALI_TIMINGS && CONFIG_PROC_FS */
static unsigned int init_chipset_ali15x3(struct pci_dev *, const char *); static unsigned int init_chipset_ali15x3(struct pci_dev *, const char *);
static void init_hwif_common_ali15x3(ide_hwif_t *); static void init_hwif_common_ali15x3(ide_hwif_t *);
static void init_hwif_ali15x3(ide_hwif_t *); static void init_hwif_ali15x3(ide_hwif_t *);
......
...@@ -88,6 +88,8 @@ static unsigned char amd_cyc2udma[] = { 6, 6, 5, 4, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3 ...@@ -88,6 +88,8 @@ static unsigned char amd_cyc2udma[] = { 6, 6, 5, 4, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3
#include <linux/stat.h> #include <linux/stat.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
static u8 amd74xx_proc;
static unsigned char amd_udma2cyc[] = { 4, 6, 8, 10, 3, 2, 1, 15 }; static unsigned char amd_udma2cyc[] = { 4, 6, 8, 10, 3, 2, 1, 15 };
static unsigned long amd_base; static unsigned long amd_base;
static struct pci_dev *bmide_dev; static struct pci_dev *bmide_dev;
...@@ -398,7 +400,7 @@ static unsigned int __init init_chipset_amd74xx(struct pci_dev *dev, const char ...@@ -398,7 +400,7 @@ static unsigned int __init init_chipset_amd74xx(struct pci_dev *dev, const char
if (!amd74xx_proc) { if (!amd74xx_proc) {
amd_base = pci_resource_start(dev, 4); amd_base = pci_resource_start(dev, 4);
bmide_dev = dev; bmide_dev = dev;
ide_pci_register_host_proc(&amd74xx_procs[0]); ide_pci_create_host_proc("amd74xx", amd74xx_get_info);
amd74xx_proc = 1; amd74xx_proc = 1;
} }
#endif /* DISPLAY_AMD_TIMINGS && CONFIG_PROC_FS */ #endif /* DISPLAY_AMD_TIMINGS && CONFIG_PROC_FS */
......
...@@ -7,24 +7,6 @@ ...@@ -7,24 +7,6 @@
#define DISPLAY_AMD_TIMINGS #define DISPLAY_AMD_TIMINGS
#if defined(DISPLAY_AMD_TIMINGS) && defined(CONFIG_PROC_FS)
#include <linux/stat.h>
#include <linux/proc_fs.h>
static u8 amd74xx_proc;
static int amd74xx_get_info(char *, char **, off_t, int);
static ide_pci_host_proc_t amd74xx_procs[] = {
{
.name = "amd74xx",
.set = 1,
.get_info = amd74xx_get_info,
.parent = NULL,
},
};
#endif /* defined(DISPLAY_AMD_TIMINGS) && defined(CONFIG_PROC_FS) */
static unsigned int init_chipset_amd74xx(struct pci_dev *, const char *); static unsigned int init_chipset_amd74xx(struct pci_dev *, const char *);
static void init_hwif_amd74xx(ide_hwif_t *); static void init_hwif_amd74xx(ide_hwif_t *);
......
...@@ -667,7 +667,7 @@ static unsigned int __init init_chipset_cmd64x (struct pci_dev *dev, const char ...@@ -667,7 +667,7 @@ static unsigned int __init init_chipset_cmd64x (struct pci_dev *dev, const char
if (!cmd64x_proc) { if (!cmd64x_proc) {
cmd64x_proc = 1; cmd64x_proc = 1;
ide_pci_register_host_proc(&cmd64x_procs[0]); ide_pci_create_host_proc("cmd64x", cmd64x_get_info);
} }
#endif /* DISPLAY_CMD64X_TIMINGS && CONFIG_PROC_FS */ #endif /* DISPLAY_CMD64X_TIMINGS && CONFIG_PROC_FS */
......
...@@ -60,25 +60,6 @@ ...@@ -60,25 +60,6 @@
#define UDIDETCR1 0x7B #define UDIDETCR1 0x7B
#define DTPR1 0x7C #define DTPR1 0x7C
#if defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_PROC_FS)
#include <linux/stat.h>
#include <linux/proc_fs.h>
static u8 cmd64x_proc;
static char * print_cmd64x_get_info(char *, struct pci_dev *, int);
static int cmd64x_get_info(char *, char **, off_t, int);
static ide_pci_host_proc_t cmd64x_procs[] = {
{
.name = "cmd64x",
.set = 1,
.get_info = cmd64x_get_info,
.parent = NULL,
},
};
#endif /* defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_PROC_FS) */
static unsigned int init_chipset_cmd64x(struct pci_dev *, const char *); static unsigned int init_chipset_cmd64x(struct pci_dev *, const char *);
static void init_hwif_cmd64x(ide_hwif_t *); static void init_hwif_cmd64x(ide_hwif_t *);
......
...@@ -196,7 +196,7 @@ static unsigned int __devinit init_chipset_cs5520(struct pci_dev *dev, const cha ...@@ -196,7 +196,7 @@ static unsigned int __devinit init_chipset_cs5520(struct pci_dev *dev, const cha
if (!cs5520_proc) { if (!cs5520_proc) {
cs5520_proc = 1; cs5520_proc = 1;
bmide_dev = dev; bmide_dev = dev;
ide_pci_register_host_proc(&cs5520_procs[0]); ide_pci_create_host_proc("cs5520", cs5520_get_info);
} }
#endif /* DISPLAY_CS5520_TIMINGS && CONFIG_PROC_FS */ #endif /* DISPLAY_CS5520_TIMINGS && CONFIG_PROC_FS */
return 0; return 0;
......
...@@ -7,24 +7,6 @@ ...@@ -7,24 +7,6 @@
#define DISPLAY_CS5520_TIMINGS #define DISPLAY_CS5520_TIMINGS
#if defined(DISPLAY_CS5520_TIMINGS) && defined(CONFIG_PROC_FS)
#include <linux/stat.h>
#include <linux/proc_fs.h>
static u8 cs5520_proc;
static int cs5520_get_info(char *, char **, off_t, int);
static ide_pci_host_proc_t cs5520_procs[] = {
{
.name = "cs5520",
.set = 1,
.get_info = cs5520_get_info,
.parent = NULL,
},
};
#endif /* defined(DISPLAY_CS5520_TIMINGS) && defined(CONFIG_PROC_FS) */
static unsigned int init_chipset_cs5520(struct pci_dev *, const char *); static unsigned int init_chipset_cs5520(struct pci_dev *, const char *);
static void init_hwif_cs5520(ide_hwif_t *); static void init_hwif_cs5520(ide_hwif_t *);
static void cs5520_init_setup_dma(struct pci_dev *dev, struct ide_pci_device_s *d, ide_hwif_t *hwif); static void cs5520_init_setup_dma(struct pci_dev *dev, struct ide_pci_device_s *d, ide_hwif_t *hwif);
......
...@@ -276,7 +276,7 @@ static unsigned int __init init_chipset_cs5530 (struct pci_dev *dev, const char ...@@ -276,7 +276,7 @@ static unsigned int __init init_chipset_cs5530 (struct pci_dev *dev, const char
if (!cs5530_proc) { if (!cs5530_proc) {
cs5530_proc = 1; cs5530_proc = 1;
bmide_dev = dev; bmide_dev = dev;
ide_pci_register_host_proc(&cs5530_procs[0]); ide_pci_create_host_proc("cs5530", cs5530_get_info);
} }
#endif /* DISPLAY_CS5530_TIMINGS && CONFIG_PROC_FS */ #endif /* DISPLAY_CS5530_TIMINGS && CONFIG_PROC_FS */
......
...@@ -7,24 +7,6 @@ ...@@ -7,24 +7,6 @@
#define DISPLAY_CS5530_TIMINGS #define DISPLAY_CS5530_TIMINGS
#if defined(DISPLAY_CS5530_TIMINGS) && defined(CONFIG_PROC_FS)
#include <linux/stat.h>
#include <linux/proc_fs.h>
static u8 cs5530_proc;
static int cs5530_get_info(char *, char **, off_t, int);
static ide_pci_host_proc_t cs5530_procs[] = {
{
.name = "cs5530",
.set = 1,
.get_info = cs5530_get_info,
.parent = NULL,
},
};
#endif /* DISPLAY_CS5530_TIMINGS && CONFIG_PROC_FS */
static unsigned int init_chipset_cs5530(struct pci_dev *, const char *); static unsigned int init_chipset_cs5530(struct pci_dev *, const char *);
static void init_hwif_cs5530(ide_hwif_t *); static void init_hwif_cs5530(ide_hwif_t *);
......
...@@ -282,7 +282,7 @@ static unsigned int __init init_chipset_hpt34x (struct pci_dev *dev, const char ...@@ -282,7 +282,7 @@ static unsigned int __init init_chipset_hpt34x (struct pci_dev *dev, const char
if (!hpt34x_proc) { if (!hpt34x_proc) {
hpt34x_proc = 1; hpt34x_proc = 1;
ide_pci_register_host_proc(&hpt34x_procs[0]); ide_pci_create_host_proc("hpt34x", hpt34x_get_info);
} }
#endif /* DISPLAY_HPT34X_TIMINGS && CONFIG_PROC_FS */ #endif /* DISPLAY_HPT34X_TIMINGS && CONFIG_PROC_FS */
......
...@@ -13,24 +13,6 @@ ...@@ -13,24 +13,6 @@
#undef DISPLAY_HPT34X_TIMINGS #undef DISPLAY_HPT34X_TIMINGS
#if defined(DISPLAY_HPT34X_TIMINGS) && defined(CONFIG_PROC_FS)
#include <linux/stat.h>
#include <linux/proc_fs.h>
static u8 hpt34x_proc;
static int hpt34x_get_info(char *, char **, off_t, int);
static ide_pci_host_proc_t hpt34x_procs[] = {
{
.name = "hpt34x",
.set = 1,
.get_info = hpt34x_get_info,
.parent = NULL,
},
};
#endif /* defined(DISPLAY_HPT34X_TIMINGS) && defined(CONFIG_PROC_FS) */
static unsigned int init_chipset_hpt34x(struct pci_dev *, const char *); static unsigned int init_chipset_hpt34x(struct pci_dev *, const char *);
static void init_hwif_hpt34x(ide_hwif_t *); static void init_hwif_hpt34x(ide_hwif_t *);
......
...@@ -972,7 +972,7 @@ static unsigned int __init init_chipset_hpt366 (struct pci_dev *dev, const char ...@@ -972,7 +972,7 @@ static unsigned int __init init_chipset_hpt366 (struct pci_dev *dev, const char
if (!hpt366_proc) { if (!hpt366_proc) {
hpt366_proc = 1; hpt366_proc = 1;
ide_pci_register_host_proc(&hpt366_procs[0]); ide_pci_create_host_proc("hpt366", hpt366_get_info);
} }
#endif /* DISPLAY_HPT366_TIMINGS && CONFIG_PROC_FS */ #endif /* DISPLAY_HPT366_TIMINGS && CONFIG_PROC_FS */
......
...@@ -416,24 +416,6 @@ struct chipset_bus_clock_list_entry sixty_six_base_hpt374[] = { ...@@ -416,24 +416,6 @@ struct chipset_bus_clock_list_entry sixty_six_base_hpt374[] = {
#define F_LOW_PCI_50 0x2d #define F_LOW_PCI_50 0x2d
#define F_LOW_PCI_66 0x42 #define F_LOW_PCI_66 0x42
#if defined(DISPLAY_HPT366_TIMINGS) && defined(CONFIG_PROC_FS)
#include <linux/stat.h>
#include <linux/proc_fs.h>
static u8 hpt366_proc;
static int hpt366_get_info(char *, char **, off_t, int);
static ide_pci_host_proc_t hpt366_procs[] = {
{
.name = "hpt366",
.set = 1,
.get_info = hpt366_get_info,
.parent = NULL,
},
};
#endif /* defined(DISPLAY_HPT366_TIMINGS) && defined(CONFIG_PROC_FS) */
static void init_setup_hpt366(struct pci_dev *, ide_pci_device_t *); static void init_setup_hpt366(struct pci_dev *, ide_pci_device_t *);
static void init_setup_hpt37x(struct pci_dev *, ide_pci_device_t *); static void init_setup_hpt37x(struct pci_dev *, ide_pci_device_t *);
static void init_setup_hpt374(struct pci_dev *, ide_pci_device_t *); static void init_setup_hpt374(struct pci_dev *, ide_pci_device_t *);
......
...@@ -574,7 +574,7 @@ static unsigned int __init init_chipset_pdcnew (struct pci_dev *dev, const char ...@@ -574,7 +574,7 @@ static unsigned int __init init_chipset_pdcnew (struct pci_dev *dev, const char
if (!pdcnew_proc) { if (!pdcnew_proc) {
pdcnew_proc = 1; pdcnew_proc = 1;
ide_pci_register_host_proc(&pdcnew_procs[0]); ide_pci_create_host_proc("pdcnew", pdcnew_get_info);
} }
#endif /* DISPLAY_PDC202XX_TIMINGS && CONFIG_PROC_FS */ #endif /* DISPLAY_PDC202XX_TIMINGS && CONFIG_PROC_FS */
......
...@@ -164,25 +164,6 @@ static void decode_registers (u8 registers, u8 value) ...@@ -164,25 +164,6 @@ static void decode_registers (u8 registers, u8 value)
#define DISPLAY_PDC202XX_TIMINGS #define DISPLAY_PDC202XX_TIMINGS
#if defined(DISPLAY_PDC202XX_TIMINGS) && defined(CONFIG_PROC_FS)
#include <linux/stat.h>
#include <linux/proc_fs.h>
static u8 pdcnew_proc;
static int pdcnew_get_info(char *, char **, off_t, int);
static ide_pci_host_proc_t pdcnew_procs[] = {
{
.name = "pdcnew",
.set = 1,
.get_info = pdcnew_get_info,
.parent = NULL,
},
};
#endif /* DISPLAY_PDC202XX_TIMINGS && CONFIG_PROC_FS */
static void init_setup_pdcnew(struct pci_dev *, ide_pci_device_t *); static void init_setup_pdcnew(struct pci_dev *, ide_pci_device_t *);
static void init_setup_pdc20270(struct pci_dev *, ide_pci_device_t *); static void init_setup_pdc20270(struct pci_dev *, ide_pci_device_t *);
static void init_setup_pdc20276(struct pci_dev *dev, ide_pci_device_t *d); static void init_setup_pdc20276(struct pci_dev *dev, ide_pci_device_t *d);
......
...@@ -707,7 +707,7 @@ static unsigned int __init init_chipset_pdc202xx (struct pci_dev *dev, const cha ...@@ -707,7 +707,7 @@ static unsigned int __init init_chipset_pdc202xx (struct pci_dev *dev, const cha
if (!pdc202xx_proc) { if (!pdc202xx_proc) {
pdc202xx_proc = 1; pdc202xx_proc = 1;
ide_pci_register_host_proc(&pdc202xx_procs[0]); ide_pci_create_host_proc("pdc202xx", pdc202xx_get_info);
} }
#endif /* DISPLAY_PDC202XX_TIMINGS && CONFIG_PROC_FS */ #endif /* DISPLAY_PDC202XX_TIMINGS && CONFIG_PROC_FS */
......
...@@ -199,25 +199,6 @@ static void decode_registers (u8 registers, u8 value) ...@@ -199,25 +199,6 @@ static void decode_registers (u8 registers, u8 value)
#define DISPLAY_PDC202XX_TIMINGS #define DISPLAY_PDC202XX_TIMINGS
#if defined(DISPLAY_PDC202XX_TIMINGS) && defined(CONFIG_PROC_FS)
#include <linux/stat.h>
#include <linux/proc_fs.h>
static u8 pdc202xx_proc;
static int pdc202xx_get_info(char *, char **, off_t, int);
static ide_pci_host_proc_t pdc202xx_procs[] = {
{
.name = "pdc202xx",
.set = 1,
.get_info = pdc202xx_get_info,
.parent = NULL,
},
};
#endif /* DISPLAY_PDC202XX_TIMINGS && CONFIG_PROC_FS */
static void init_setup_pdc202ata4(struct pci_dev *dev, ide_pci_device_t *d); static void init_setup_pdc202ata4(struct pci_dev *dev, ide_pci_device_t *d);
static void init_setup_pdc20265(struct pci_dev *, ide_pci_device_t *); static void init_setup_pdc20265(struct pci_dev *, ide_pci_device_t *);
static void init_setup_pdc202xx(struct pci_dev *, ide_pci_device_t *); static void init_setup_pdc202xx(struct pci_dev *, ide_pci_device_t *);
......
...@@ -636,7 +636,7 @@ static unsigned int __devinit init_chipset_piix (struct pci_dev *dev, const char ...@@ -636,7 +636,7 @@ static unsigned int __devinit init_chipset_piix (struct pci_dev *dev, const char
if (!piix_proc) { if (!piix_proc) {
piix_proc = 1; piix_proc = 1;
ide_pci_register_host_proc(&piix_procs[0]); ide_pci_create_host_proc("piix", piix_get_info);
} }
#endif /* DISPLAY_PIIX_TIMINGS && CONFIG_PROC_FS */ #endif /* DISPLAY_PIIX_TIMINGS && CONFIG_PROC_FS */
return 0; return 0;
......
...@@ -9,24 +9,6 @@ ...@@ -9,24 +9,6 @@
#define DISPLAY_PIIX_TIMINGS #define DISPLAY_PIIX_TIMINGS
#if defined(DISPLAY_PIIX_TIMINGS) && defined(CONFIG_PROC_FS)
#include <linux/stat.h>
#include <linux/proc_fs.h>
static u8 piix_proc;
static int piix_get_info(char *, char **, off_t, int);
static ide_pci_host_proc_t piix_procs[] = {
{
.name = "piix",
.set = 1,
.get_info = piix_get_info,
.parent = NULL,
},
};
#endif /* defined(DISPLAY_PIIX_TIMINGS) && defined(CONFIG_PROC_FS) */
static void init_setup_piix(struct pci_dev *, ide_pci_device_t *); static void init_setup_piix(struct pci_dev *, ide_pci_device_t *);
static unsigned int __devinit init_chipset_piix(struct pci_dev *, const char *); static unsigned int __devinit init_chipset_piix(struct pci_dev *, const char *);
static void init_hwif_piix(ide_hwif_t *); static void init_hwif_piix(ide_hwif_t *);
......
...@@ -515,7 +515,7 @@ static unsigned int __init init_chipset_sc1200 (struct pci_dev *dev, const char ...@@ -515,7 +515,7 @@ static unsigned int __init init_chipset_sc1200 (struct pci_dev *dev, const char
if (!bmide_dev) { if (!bmide_dev) {
sc1200_proc = 1; sc1200_proc = 1;
bmide_dev = dev; bmide_dev = dev;
ide_pci_register_host_proc(&sc1200_procs[0]); ide_pci_create_host_proc("sc1200", sc1200_get_info);
} }
#endif /* DISPLAY_SC1200_TIMINGS && CONFIG_PROC_FS */ #endif /* DISPLAY_SC1200_TIMINGS && CONFIG_PROC_FS */
return 0; return 0;
......
...@@ -7,24 +7,6 @@ ...@@ -7,24 +7,6 @@
#define DISPLAY_SC1200_TIMINGS #define DISPLAY_SC1200_TIMINGS
#if defined(DISPLAY_SC1200_TIMINGS) && defined(CONFIG_PROC_FS)
#include <linux/stat.h>
#include <linux/proc_fs.h>
static u8 sc1200_proc;
static int sc1200_get_info(char *, char **, off_t, int);
static ide_pci_host_proc_t sc1200_procs[] = {
{
.name = "sc1200",
.set = 1,
.get_info = sc1200_get_info,
.parent = NULL,
},
};
#endif /* DISPLAY_SC1200_TIMINGS && CONFIG_PROC_FS */
static unsigned int init_chipset_sc1200(struct pci_dev *, const char *); static unsigned int init_chipset_sc1200(struct pci_dev *, const char *);
static void init_hwif_sc1200(ide_hwif_t *); static void init_hwif_sc1200(ide_hwif_t *);
......
...@@ -621,7 +621,7 @@ static unsigned int __init init_chipset_svwks (struct pci_dev *dev, const char * ...@@ -621,7 +621,7 @@ static unsigned int __init init_chipset_svwks (struct pci_dev *dev, const char *
if (!svwks_proc) { if (!svwks_proc) {
svwks_proc = 1; svwks_proc = 1;
ide_pci_register_host_proc(&svwks_procs[0]); ide_pci_create_host_proc("svwks", svwks_get_info);
} }
#endif /* DISPLAY_SVWKS_TIMINGS && CONFIG_PROC_FS */ #endif /* DISPLAY_SVWKS_TIMINGS && CONFIG_PROC_FS */
......
...@@ -23,24 +23,6 @@ const char *svwks_bad_ata100[] = { ...@@ -23,24 +23,6 @@ const char *svwks_bad_ata100[] = {
#define DISPLAY_SVWKS_TIMINGS 1 #define DISPLAY_SVWKS_TIMINGS 1
#if defined(DISPLAY_SVWKS_TIMINGS) && defined(CONFIG_PROC_FS)
#include <linux/stat.h>
#include <linux/proc_fs.h>
static u8 svwks_proc;
static int svwks_get_info(char *, char **, off_t, int);
static ide_pci_host_proc_t svwks_procs[] = {
{
.name = "svwks",
.set = 1,
.get_info = svwks_get_info,
.parent = NULL,
},
};
#endif /* defined(DISPLAY_SVWKS_TIMINGS) && defined(CONFIG_PROC_FS) */
static void init_setup_svwks(struct pci_dev *, ide_pci_device_t *); static void init_setup_svwks(struct pci_dev *, ide_pci_device_t *);
static void init_setup_csb6(struct pci_dev *, ide_pci_device_t *); static void init_setup_csb6(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_svwks(struct pci_dev *, const char *); static unsigned int init_chipset_svwks(struct pci_dev *, const char *);
......
...@@ -785,7 +785,7 @@ static void proc_reports_siimage (struct pci_dev *dev, u8 clocking, const char * ...@@ -785,7 +785,7 @@ static void proc_reports_siimage (struct pci_dev *dev, u8 clocking, const char *
if (!siimage_proc) { if (!siimage_proc) {
siimage_proc = 1; siimage_proc = 1;
ide_pci_register_host_proc(&siimage_procs[0]); ide_pci_create_host_proc("siimage", siimage_get_info);
} }
#endif /* DISPLAY_SIIMAGE_TIMINGS && CONFIG_PROC_FS */ #endif /* DISPLAY_SIIMAGE_TIMINGS && CONFIG_PROC_FS */
} }
......
...@@ -21,26 +21,6 @@ ...@@ -21,26 +21,6 @@
#define siiprintk(x...) #define siiprintk(x...)
#endif #endif
#if defined(DISPLAY_SIIMAGE_TIMINGS) && defined(CONFIG_PROC_FS)
#include <linux/stat.h>
#include <linux/proc_fs.h>
static char * print_siimage_get_info(char *, struct pci_dev *, int);
static int siimage_get_info(char *, char **, off_t, int);
static u8 siimage_proc;
static ide_pci_host_proc_t siimage_procs[] = {
{
.name = "siimage",
.set = 1,
.get_info = siimage_get_info,
.parent = NULL,
},
};
#endif /* DISPLAY_SIIMAGE_TIMINGS && CONFIG_PROC_FS */
static unsigned int init_chipset_siimage(struct pci_dev *, const char *); static unsigned int init_chipset_siimage(struct pci_dev *, const char *);
static void init_iops_siimage(ide_hwif_t *); static void init_iops_siimage(ide_hwif_t *);
static void init_hwif_siimage(ide_hwif_t *); static void init_hwif_siimage(ide_hwif_t *);
......
...@@ -881,7 +881,7 @@ static unsigned int __init init_chipset_sis5513 (struct pci_dev *dev, const char ...@@ -881,7 +881,7 @@ static unsigned int __init init_chipset_sis5513 (struct pci_dev *dev, const char
if (!sis_proc) { if (!sis_proc) {
sis_proc = 1; sis_proc = 1;
bmide_dev = dev; bmide_dev = dev;
ide_pci_register_host_proc(&sis_procs[0]); ide_pci_create_host_proc("sis", sis_get_info);
} }
#endif #endif
} }
......
...@@ -7,24 +7,6 @@ ...@@ -7,24 +7,6 @@
#define DISPLAY_SIS_TIMINGS #define DISPLAY_SIS_TIMINGS
#if defined(DISPLAY_SIS_TIMINGS) && defined(CONFIG_PROC_FS)
#include <linux/stat.h>
#include <linux/proc_fs.h>
static u8 sis_proc;
static int sis_get_info(char *, char **, off_t, int);
static ide_pci_host_proc_t sis_procs[] = {
{
.name = "sis",
.set = 1,
.get_info = sis_get_info,
.parent = NULL,
},
};
#endif /* defined(DISPLAY_SIS_TIMINGS) && defined(CONFIG_PROC_FS) */
static unsigned int init_chipset_sis5513(struct pci_dev *, const char *); static unsigned int init_chipset_sis5513(struct pci_dev *, const char *);
static void init_hwif_sis5513(ide_hwif_t *); static void init_hwif_sis5513(ide_hwif_t *);
......
...@@ -319,7 +319,7 @@ static unsigned int __init init_chipset_slc90e66 (struct pci_dev *dev, const cha ...@@ -319,7 +319,7 @@ static unsigned int __init init_chipset_slc90e66 (struct pci_dev *dev, const cha
if (!slc90e66_proc) { if (!slc90e66_proc) {
slc90e66_proc = 1; slc90e66_proc = 1;
bmide_dev = dev; bmide_dev = dev;
ide_pci_register_host_proc(&slc90e66_procs[0]); ide_pci_create_host_proc("slc90e66", slc90e66_get_info);
} }
#endif /* DISPLAY_SLC90E66_TIMINGS && CONFIG_PROC_FS */ #endif /* DISPLAY_SLC90E66_TIMINGS && CONFIG_PROC_FS */
return 0; return 0;
......
...@@ -9,24 +9,6 @@ ...@@ -9,24 +9,6 @@
#define SLC90E66_DEBUG_DRIVE_INFO 0 #define SLC90E66_DEBUG_DRIVE_INFO 0
#if defined(DISPLAY_SLC90E66_TIMINGS) && defined(CONFIG_PROC_FS)
#include <linux/stat.h>
#include <linux/proc_fs.h>
static u8 slc90e66_proc;
static int slc90e66_get_info(char *, char **, off_t, int);
static ide_pci_host_proc_t slc90e66_procs[] = {
{
.name = "slc90e66",
.set = 1,
.get_info = slc90e66_get_info,
.parent = NULL,
},
};
#endif /* defined(DISPLAY_SLC90E66_TIMINGS) && defined(CONFIG_PROC_FS) */
static unsigned int init_chipset_slc90e66(struct pci_dev *, const char *); static unsigned int init_chipset_slc90e66(struct pci_dev *, const char *);
static void init_hwif_slc90e66(ide_hwif_t *); static void init_hwif_slc90e66(ide_hwif_t *);
......
...@@ -212,7 +212,7 @@ static unsigned int __init init_chipset_triflex(struct pci_dev *dev, ...@@ -212,7 +212,7 @@ static unsigned int __init init_chipset_triflex(struct pci_dev *dev,
const char *name) const char *name)
{ {
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
ide_pci_register_host_proc(&triflex_proc); ide_pci_create_host_proc("triflex", triflex_get_info);
#endif #endif
return 0; return 0;
} }
......
...@@ -14,15 +14,6 @@ ...@@ -14,15 +14,6 @@
static unsigned int __devinit init_chipset_triflex(struct pci_dev *, const char *); static unsigned int __devinit init_chipset_triflex(struct pci_dev *, const char *);
static void init_hwif_triflex(ide_hwif_t *); static void init_hwif_triflex(ide_hwif_t *);
#ifdef CONFIG_PROC_FS
static int triflex_get_info(char *, char **, off_t, int);
static ide_pci_host_proc_t triflex_proc = {
.name = "triflex",
.set = 1,
.get_info = triflex_get_info,
};
#endif
static ide_pci_device_t triflex_devices[] __devinitdata = { static ide_pci_device_t triflex_devices[] __devinitdata = {
{ {
......
...@@ -567,7 +567,7 @@ static unsigned int __init init_chipset_via82cxxx(struct pci_dev *dev, const cha ...@@ -567,7 +567,7 @@ static unsigned int __init init_chipset_via82cxxx(struct pci_dev *dev, const cha
via_base = pci_resource_start(dev, 4); via_base = pci_resource_start(dev, 4);
bmide_dev = dev; bmide_dev = dev;
isa_dev = isa; isa_dev = isa;
ide_pci_register_host_proc(&via_procs[0]); ide_pci_create_host_proc("via", via_get_info);
via_proc = 1; via_proc = 1;
} }
#endif /* DISPLAY_VIA_TIMINGS && CONFIG_PROC_FS */ #endif /* DISPLAY_VIA_TIMINGS && CONFIG_PROC_FS */
......
...@@ -7,24 +7,6 @@ ...@@ -7,24 +7,6 @@
#define DISPLAY_VIA_TIMINGS #define DISPLAY_VIA_TIMINGS
#if defined(DISPLAY_VIA_TIMINGS) && defined(CONFIG_PROC_FS)
#include <linux/stat.h>
#include <linux/proc_fs.h>
static u8 via_proc;
static int via_get_info(char *, char **, off_t, int);
static ide_pci_host_proc_t via_procs[] = {
{
.name = "via",
.set = 1,
.get_info = via_get_info,
.parent = NULL,
},
};
#endif /* DISPLAY_VIA_TIMINGS && CONFIG_PROC_FS */
static unsigned int init_chipset_via82cxxx(struct pci_dev *, const char *); static unsigned int init_chipset_via82cxxx(struct pci_dev *, const char *);
static void init_hwif_via82cxxx(ide_hwif_t *); static void init_hwif_via82cxxx(ide_hwif_t *);
......
...@@ -1087,6 +1087,8 @@ typedef struct { ...@@ -1087,6 +1087,8 @@ typedef struct {
} ide_proc_entry_t; } ide_proc_entry_t;
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
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_device(ide_hwif_t *, ide_drive_t *); extern void destroy_proc_ide_device(ide_hwif_t *, ide_drive_t *);
...@@ -1097,6 +1099,10 @@ extern void ide_remove_proc_entries(struct proc_dir_entry *, ide_proc_entry_t *) ...@@ -1097,6 +1099,10 @@ 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;
read_proc_t proc_ide_read_geometry; read_proc_t proc_ide_read_geometry;
#ifdef CONFIG_BLK_DEV_IDEPCI
void ide_pci_create_host_proc(const char *, get_info_t *);
#endif
/* /*
* Standard exit stuff: * Standard exit stuff:
*/ */
...@@ -1522,18 +1528,6 @@ int ide_register_subdriver(ide_drive_t *, ide_driver_t *); ...@@ -1522,18 +1528,6 @@ int ide_register_subdriver(ide_drive_t *, ide_driver_t *);
int ide_unregister_subdriver (ide_drive_t *drive); int ide_unregister_subdriver (ide_drive_t *drive);
int ide_replace_subdriver(ide_drive_t *drive, const char *driver); int ide_replace_subdriver(ide_drive_t *drive, const char *driver);
#ifdef CONFIG_PROC_FS
typedef struct ide_pci_host_proc_s {
char *name;
u8 set;
get_info_t *get_info;
struct proc_dir_entry *parent;
struct ide_pci_host_proc_s *next;
} ide_pci_host_proc_t;
void ide_pci_register_host_proc(ide_pci_host_proc_t *);
#endif /* CONFIG_PROC_FS */
#define ON_BOARD 1 #define ON_BOARD 1
#define NEVER_BOARD 0 #define NEVER_BOARD 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