Commit 0d567824 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] Remove unused high-level IDE ->init method

->init() for high-level drivers is never called (other than as
module_init() when they are initialized).  Method removed, instances
cleaned up.
parent b20830fb
...@@ -3047,7 +3047,6 @@ int ide_cdrom_cleanup(ide_drive_t *drive) ...@@ -3047,7 +3047,6 @@ int ide_cdrom_cleanup(ide_drive_t *drive)
return 0; return 0;
} }
static int ide_cdrom_init(void);
static int ide_cdrom_reinit (ide_drive_t *drive); static int ide_cdrom_reinit (ide_drive_t *drive);
static ide_driver_t ide_cdrom_driver = { static ide_driver_t ide_cdrom_driver = {
...@@ -3080,7 +3079,6 @@ static ide_driver_t ide_cdrom_driver = { ...@@ -3080,7 +3079,6 @@ static ide_driver_t ide_cdrom_driver = {
capacity: ide_cdrom_capacity, capacity: ide_cdrom_capacity,
special: NULL, special: NULL,
proc: NULL, proc: NULL,
init: ide_cdrom_init,
reinit: ide_cdrom_reinit, reinit: ide_cdrom_reinit,
ata_prebuilder: NULL, ata_prebuilder: NULL,
atapi_prebuilder: NULL, atapi_prebuilder: NULL,
...@@ -3088,10 +3086,7 @@ static ide_driver_t ide_cdrom_driver = { ...@@ -3088,10 +3086,7 @@ static ide_driver_t ide_cdrom_driver = {
}; };
static ide_module_t ide_cdrom_module = { static ide_module_t ide_cdrom_module = {
IDE_DRIVER_MODULE, info: &ide_cdrom_driver,
ide_cdrom_init,
&ide_cdrom_driver,
NULL
}; };
/* options */ /* options */
...@@ -3153,9 +3148,7 @@ static void __exit ide_cdrom_exit(void) ...@@ -3153,9 +3148,7 @@ static void __exit ide_cdrom_exit(void)
static int ide_cdrom_init(void) static int ide_cdrom_init(void)
{ {
MOD_INC_USE_COUNT;
ide_register_module(&ide_cdrom_module); ide_register_module(&ide_cdrom_module);
MOD_DEC_USE_COUNT;
return 0; return 0;
} }
......
...@@ -1636,7 +1636,6 @@ static int idedisk_cleanup (ide_drive_t *drive) ...@@ -1636,7 +1636,6 @@ static int idedisk_cleanup (ide_drive_t *drive)
return ide_unregister_subdriver(drive); return ide_unregister_subdriver(drive);
} }
static int idedisk_init (void);
static int idedisk_reinit(ide_drive_t *drive); static int idedisk_reinit(ide_drive_t *drive);
/* /*
...@@ -1668,7 +1667,6 @@ static ide_driver_t idedisk_driver = { ...@@ -1668,7 +1667,6 @@ static ide_driver_t idedisk_driver = {
capacity: idedisk_capacity, capacity: idedisk_capacity,
special: idedisk_special, special: idedisk_special,
proc: idedisk_proc, proc: idedisk_proc,
init: idedisk_init,
reinit: idedisk_reinit, reinit: idedisk_reinit,
ata_prebuilder: NULL, ata_prebuilder: NULL,
atapi_prebuilder: NULL, atapi_prebuilder: NULL,
...@@ -1676,10 +1674,7 @@ static ide_driver_t idedisk_driver = { ...@@ -1676,10 +1674,7 @@ static ide_driver_t idedisk_driver = {
}; };
static ide_module_t idedisk_module = { static ide_module_t idedisk_module = {
IDE_DRIVER_MODULE, info: &idedisk_driver,
idedisk_init,
&idedisk_driver,
NULL
}; };
MODULE_DESCRIPTION("ATA DISK Driver"); MODULE_DESCRIPTION("ATA DISK Driver");
...@@ -1720,9 +1715,7 @@ static void __exit idedisk_exit (void) ...@@ -1720,9 +1715,7 @@ static void __exit idedisk_exit (void)
static int idedisk_init (void) static int idedisk_init (void)
{ {
MOD_INC_USE_COUNT;
ide_register_module(&idedisk_module); ide_register_module(&idedisk_module);
MOD_DEC_USE_COUNT;
return 0; return 0;
} }
......
...@@ -2143,7 +2143,6 @@ static ide_proc_entry_t idefloppy_proc[] = { ...@@ -2143,7 +2143,6 @@ static ide_proc_entry_t idefloppy_proc[] = {
#endif /* CONFIG_PROC_FS */ #endif /* CONFIG_PROC_FS */
static int idefloppy_init (void);
static int idefloppy_reinit(ide_drive_t *drive); static int idefloppy_reinit(ide_drive_t *drive);
/* /*
...@@ -2179,7 +2178,6 @@ static ide_driver_t idefloppy_driver = { ...@@ -2179,7 +2178,6 @@ static ide_driver_t idefloppy_driver = {
capacity: idefloppy_capacity, capacity: idefloppy_capacity,
special: NULL, special: NULL,
proc: idefloppy_proc, proc: idefloppy_proc,
init: idefloppy_init,
reinit: idefloppy_reinit, reinit: idefloppy_reinit,
ata_prebuilder: NULL, ata_prebuilder: NULL,
atapi_prebuilder: NULL, atapi_prebuilder: NULL,
...@@ -2187,10 +2185,7 @@ static ide_driver_t idefloppy_driver = { ...@@ -2187,10 +2185,7 @@ static ide_driver_t idefloppy_driver = {
}; };
static ide_module_t idefloppy_module = { static ide_module_t idefloppy_module = {
IDE_DRIVER_MODULE, info: &idefloppy_driver,
idefloppy_init,
&idefloppy_driver,
NULL
}; };
static int idefloppy_reinit (ide_drive_t *drive) static int idefloppy_reinit (ide_drive_t *drive)
...@@ -2240,9 +2235,7 @@ static void __exit idefloppy_exit (void) ...@@ -2240,9 +2235,7 @@ static void __exit idefloppy_exit (void)
static int idefloppy_init (void) static int idefloppy_init (void)
{ {
printk("ide-floppy driver " IDEFLOPPY_VERSION "\n"); printk("ide-floppy driver " IDEFLOPPY_VERSION "\n");
MOD_INC_USE_COUNT;
ide_register_module(&idefloppy_module); ide_register_module(&idefloppy_module);
MOD_DEC_USE_COUNT;
return 0; return 0;
} }
......
...@@ -1424,7 +1424,6 @@ typedef struct { ...@@ -1424,7 +1424,6 @@ typedef struct {
* Additional state variables are defined in our ide_drive_t structure. * Additional state variables are defined in our ide_drive_t structure.
*/ */
static idetape_chrdev_t idetape_chrdevs[MAX_HWIFS * MAX_DRIVES]; static idetape_chrdev_t idetape_chrdevs[MAX_HWIFS * MAX_DRIVES];
static int idetape_chrdev_present = 0;
#if IDETAPE_DEBUG_LOG_VERBOSE #if IDETAPE_DEBUG_LOG_VERBOSE
...@@ -6300,7 +6299,6 @@ static ide_proc_entry_t idetape_proc[] = { ...@@ -6300,7 +6299,6 @@ static ide_proc_entry_t idetape_proc[] = {
#endif #endif
static int idetape_init (void);
static int idetape_reinit(ide_drive_t *drive); static int idetape_reinit(ide_drive_t *drive);
/* /*
...@@ -6336,7 +6334,6 @@ static ide_driver_t idetape_driver = { ...@@ -6336,7 +6334,6 @@ static ide_driver_t idetape_driver = {
capacity: NULL, capacity: NULL,
special: NULL, special: NULL,
proc: idetape_proc, proc: idetape_proc,
init: idetape_init,
reinit: idetape_reinit, reinit: idetape_reinit,
ata_prebuilder: NULL, ata_prebuilder: NULL,
atapi_prebuilder: NULL, atapi_prebuilder: NULL,
...@@ -6344,10 +6341,7 @@ static ide_driver_t idetape_driver = { ...@@ -6344,10 +6341,7 @@ static ide_driver_t idetape_driver = {
}; };
static ide_module_t idetape_module = { static ide_module_t idetape_module = {
IDE_DRIVER_MODULE, info: &idetape_driver,
idetape_init,
&idetape_driver,
NULL
}; };
/* /*
...@@ -6422,7 +6416,6 @@ static void __exit idetape_exit (void) ...@@ -6422,7 +6416,6 @@ static void __exit idetape_exit (void)
{ {
ide_unregister_module(&idetape_module); ide_unregister_module(&idetape_module);
unregister_chrdev(IDETAPE_MAJOR, "ht"); unregister_chrdev(IDETAPE_MAJOR, "ht");
idetape_chrdev_present = 0;
} }
/* /*
...@@ -6430,17 +6423,11 @@ static void __exit idetape_exit (void) ...@@ -6430,17 +6423,11 @@ static void __exit idetape_exit (void)
*/ */
static int idetape_init (void) static int idetape_init (void)
{ {
MOD_INC_USE_COUNT; if (register_chrdev(IDETAPE_MAJOR, "ht", &idetape_fops)) {
if (!idetape_chrdev_present) { printk(KERN_ERR "ide-tape: Failed to register character device interface\n");
idetape_chrdev_present = 1; return -EBUSY;
if (register_chrdev(IDETAPE_MAJOR, "ht", &idetape_fops)) {
printk(KERN_ERR "ide-tape: Failed to register character device interface\n");
MOD_DEC_USE_COUNT;
return -EBUSY;
}
} }
ide_register_module(&idetape_module); ide_register_module(&idetape_module);
MOD_DEC_USE_COUNT;
return 0; return 0;
} }
......
...@@ -3436,11 +3436,6 @@ static ide_startstop_t default_special (ide_drive_t *drive) ...@@ -3436,11 +3436,6 @@ static ide_startstop_t default_special (ide_drive_t *drive)
return ide_stopped; return ide_stopped;
} }
static int default_init (void)
{
return 0;
}
static int default_reinit (ide_drive_t *drive) static int default_reinit (ide_drive_t *drive)
{ {
printk(KERN_ERR "%s: does not support hotswap of device class !\n", drive->name); printk(KERN_ERR "%s: does not support hotswap of device class !\n", drive->name);
...@@ -3468,7 +3463,6 @@ static void setup_driver_defaults (ide_drive_t *drive) ...@@ -3468,7 +3463,6 @@ static void setup_driver_defaults (ide_drive_t *drive)
if (d->pre_reset == NULL) d->pre_reset = default_pre_reset; if (d->pre_reset == NULL) d->pre_reset = default_pre_reset;
if (d->capacity == NULL) d->capacity = default_capacity; if (d->capacity == NULL) d->capacity = default_capacity;
if (d->special == NULL) d->special = default_special; if (d->special == NULL) d->special = default_special;
if (d->init == NULL) d->init = default_init;
if (d->reinit == NULL) d->reinit = default_reinit; if (d->reinit == NULL) d->reinit = default_reinit;
} }
......
...@@ -491,7 +491,6 @@ static void idescsi_ide_release (struct inode *inode, struct file *filp, ide_dri ...@@ -491,7 +491,6 @@ static void idescsi_ide_release (struct inode *inode, struct file *filp, ide_dri
} }
static ide_drive_t *idescsi_drives[MAX_HWIFS * MAX_DRIVES]; static ide_drive_t *idescsi_drives[MAX_HWIFS * MAX_DRIVES];
static int idescsi_initialized = 0;
static void idescsi_add_settings(ide_drive_t *drive) static void idescsi_add_settings(ide_drive_t *drive)
{ {
...@@ -570,12 +569,8 @@ static ide_driver_t idescsi_driver = { ...@@ -570,12 +569,8 @@ static ide_driver_t idescsi_driver = {
drives: LIST_HEAD_INIT(idescsi_driver.drives), drives: LIST_HEAD_INIT(idescsi_driver.drives),
}; };
static int idescsi_init (void);
static ide_module_t idescsi_module = { static ide_module_t idescsi_module = {
IDE_DRIVER_MODULE, info: &idescsi_driver,
idescsi_init,
&idescsi_driver,
NULL
}; };
static int idescsi_reinit(ide_drive_t *drive) static int idescsi_reinit(ide_drive_t *drive)
...@@ -607,24 +602,6 @@ static int idescsi_reinit(ide_drive_t *drive) ...@@ -607,24 +602,6 @@ static int idescsi_reinit(ide_drive_t *drive)
return 1; return 1;
} }
/*
* idescsi_init will register the driver for each scsi.
*/
static int idescsi_init (void)
{
int i;
if (idescsi_initialized)
return 0;
idescsi_initialized = 1;
for (i = 0; i < MAX_HWIFS * MAX_DRIVES; i++)
idescsi_drives[i] = NULL;
MOD_INC_USE_COUNT;
ide_register_module(&idescsi_module);
MOD_DEC_USE_COUNT;
return 0;
}
int idescsi_detect (Scsi_Host_Template *host_template) int idescsi_detect (Scsi_Host_Template *host_template)
{ {
struct Scsi_Host *host; struct Scsi_Host *host;
...@@ -870,7 +847,7 @@ static Scsi_Host_Template idescsi_template = { ...@@ -870,7 +847,7 @@ static Scsi_Host_Template idescsi_template = {
static int __init init_idescsi_module(void) static int __init init_idescsi_module(void)
{ {
idescsi_init(); ide_register_module(&idescsi_module);
scsi_register_host(&idescsi_template); scsi_register_host(&idescsi_template);
return 0; return 0;
} }
......
...@@ -915,7 +915,6 @@ typedef struct ide_driver_s { ...@@ -915,7 +915,6 @@ typedef struct ide_driver_s {
unsigned long (*capacity)(ide_drive_t *); unsigned long (*capacity)(ide_drive_t *);
ide_startstop_t (*special)(ide_drive_t *); ide_startstop_t (*special)(ide_drive_t *);
ide_proc_entry_t *proc; ide_proc_entry_t *proc;
int (*init)(void);
int (*reinit)(ide_drive_t *); int (*reinit)(ide_drive_t *);
void (*ata_prebuilder)(ide_drive_t *); void (*ata_prebuilder)(ide_drive_t *);
void (*atapi_prebuilder)(ide_drive_t *); void (*atapi_prebuilder)(ide_drive_t *);
...@@ -929,7 +928,6 @@ typedef struct ide_driver_s { ...@@ -929,7 +928,6 @@ typedef struct ide_driver_s {
*/ */
#define IDE_CHIPSET_MODULE 0 /* not supported yet */ #define IDE_CHIPSET_MODULE 0 /* not supported yet */
#define IDE_PROBE_MODULE 1 #define IDE_PROBE_MODULE 1
#define IDE_DRIVER_MODULE 2
typedef int (ide_module_init_proc)(void); typedef int (ide_module_init_proc)(void);
......
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