Commit bd877aaf authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Linus Torvalds

[PATCH] kill useless IDE_SUBDRIVER_VERSION

parent ff7e1b28
...@@ -3517,7 +3517,7 @@ static int ide_cdrom_attach (ide_drive_t *drive) ...@@ -3517,7 +3517,7 @@ static int ide_cdrom_attach (ide_drive_t *drive)
printk("%s: Can't allocate a cdrom structure\n", drive->name); printk("%s: Can't allocate a cdrom structure\n", drive->name);
goto failed; goto failed;
} }
if (ide_register_subdriver(drive, &ide_cdrom_driver, IDE_SUBDRIVER_VERSION)) { if (ide_register_subdriver(drive, &ide_cdrom_driver)) {
printk("%s: Failed to register the driver with ide.c\n", printk("%s: Failed to register the driver with ide.c\n",
drive->name); drive->name);
kfree(info); kfree(info);
......
...@@ -51,8 +51,7 @@ ide_driver_t idedefault_driver = { ...@@ -51,8 +51,7 @@ ide_driver_t idedefault_driver = {
static int idedefault_attach (ide_drive_t *drive) static int idedefault_attach (ide_drive_t *drive)
{ {
if (ide_register_subdriver(drive, if (ide_register_subdriver(drive, &idedefault_driver)) {
&idedefault_driver, IDE_SUBDRIVER_VERSION)) {
printk(KERN_ERR "ide-default: %s: Failed to register the " printk(KERN_ERR "ide-default: %s: Failed to register the "
"driver with ide.c\n", drive->name); "driver with ide.c\n", drive->name);
return 1; return 1;
......
...@@ -1829,7 +1829,7 @@ static int idedisk_attach(ide_drive_t *drive) ...@@ -1829,7 +1829,7 @@ static int idedisk_attach(ide_drive_t *drive)
if (drive->media != ide_disk) if (drive->media != ide_disk)
goto failed; goto failed;
if (ide_register_subdriver (drive, &idedisk_driver, IDE_SUBDRIVER_VERSION)) { if (ide_register_subdriver(drive, &idedisk_driver)) {
printk (KERN_ERR "ide-disk: %s: Failed to register the driver with ide.c\n", drive->name); printk (KERN_ERR "ide-disk: %s: Failed to register the driver with ide.c\n", drive->name);
goto failed; goto failed;
} }
......
...@@ -2055,7 +2055,7 @@ static int idefloppy_attach (ide_drive_t *drive) ...@@ -2055,7 +2055,7 @@ static int idefloppy_attach (ide_drive_t *drive)
printk (KERN_ERR "ide-floppy: %s: Can't allocate a floppy structure\n", drive->name); printk (KERN_ERR "ide-floppy: %s: Can't allocate a floppy structure\n", drive->name);
goto failed; goto failed;
} }
if (ide_register_subdriver (drive, &idefloppy_driver, IDE_SUBDRIVER_VERSION)) { if (ide_register_subdriver(drive, &idefloppy_driver)) {
printk (KERN_ERR "ide-floppy: %s: Failed to register the driver with ide.c\n", drive->name); printk (KERN_ERR "ide-floppy: %s: Failed to register the driver with ide.c\n", drive->name);
kfree (floppy); kfree (floppy);
goto failed; goto failed;
......
...@@ -4854,7 +4854,7 @@ static int idetape_attach (ide_drive_t *drive) ...@@ -4854,7 +4854,7 @@ static int idetape_attach (ide_drive_t *drive)
printk(KERN_ERR "ide-tape: %s: Can't allocate a tape structure\n", drive->name); printk(KERN_ERR "ide-tape: %s: Can't allocate a tape structure\n", drive->name);
goto failed; goto failed;
} }
if (ide_register_subdriver (drive, &idetape_driver, IDE_SUBDRIVER_VERSION)) { if (ide_register_subdriver(drive, &idetape_driver)) {
printk(KERN_ERR "ide-tape: %s: Failed to register the driver with ide.c\n", drive->name); printk(KERN_ERR "ide-tape: %s: Failed to register the driver with ide.c\n", drive->name);
kfree(tape); kfree(tape);
goto failed; goto failed;
......
...@@ -2274,15 +2274,15 @@ static void setup_driver_defaults (ide_driver_t *d) ...@@ -2274,15 +2274,15 @@ static void setup_driver_defaults (ide_driver_t *d)
d->start_power_step = default_start_power_step; d->start_power_step = default_start_power_step;
} }
int ide_register_subdriver (ide_drive_t *drive, ide_driver_t *driver, int version) int ide_register_subdriver(ide_drive_t *drive, ide_driver_t *driver)
{ {
unsigned long flags; unsigned long flags;
BUG_ON(drive->driver == NULL); BUG_ON(!drive->driver);
spin_lock_irqsave(&ide_lock, flags); spin_lock_irqsave(&ide_lock, flags);
if (version != IDE_SUBDRIVER_VERSION || !drive->present || if (!drive->present || drive->driver != &idedefault_driver ||
drive->driver != &idedefault_driver || drive->usage || drive->dead) { drive->usage || drive->dead) {
spin_unlock_irqrestore(&ide_lock, flags); spin_unlock_irqrestore(&ide_lock, flags);
return 1; return 1;
} }
......
...@@ -971,8 +971,7 @@ static int idescsi_attach(ide_drive_t *drive) ...@@ -971,8 +971,7 @@ static int idescsi_attach(ide_drive_t *drive)
drive->driver_data = host; drive->driver_data = host;
idescsi = scsihost_to_idescsi(host); idescsi = scsihost_to_idescsi(host);
idescsi->drive = drive; idescsi->drive = drive;
err = ide_register_subdriver (drive, &idescsi_driver, err = ide_register_subdriver(drive, &idescsi_driver);
IDE_SUBDRIVER_VERSION);
if (!err) { if (!err) {
idescsi_setup (drive, idescsi); idescsi_setup (drive, idescsi);
drive->disk->fops = &idescsi_ops; drive->disk->fops = &idescsi_ops;
......
...@@ -1152,8 +1152,6 @@ enum { ...@@ -1152,8 +1152,6 @@ enum {
/* /*
* Subdrivers support. * Subdrivers support.
*/ */
#define IDE_SUBDRIVER_VERSION 1
typedef struct ide_driver_s { typedef struct ide_driver_s {
struct module *owner; struct module *owner;
const char *name; const char *name;
...@@ -1525,7 +1523,7 @@ extern void default_hwif_transport(ide_hwif_t *); ...@@ -1525,7 +1523,7 @@ extern void default_hwif_transport(ide_hwif_t *);
int ide_register_driver(ide_driver_t *driver); int ide_register_driver(ide_driver_t *driver);
void ide_unregister_driver(ide_driver_t *driver); void ide_unregister_driver(ide_driver_t *driver);
int ide_register_subdriver (ide_drive_t *drive, ide_driver_t *driver, int version); 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);
......
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