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

[PATCH] fix ata_probe() driver autoloading

From Andrey Borzenkov <arvidjaar@mail.ru>:

Apparently drive->driver is never NULL now but defaults to the default driver.
parent bab73009
...@@ -1147,6 +1147,8 @@ static int ata_lock(dev_t dev, void *data) ...@@ -1147,6 +1147,8 @@ static int ata_lock(dev_t dev, void *data)
return 0; return 0;
} }
extern ide_driver_t idedefault_driver;
struct kobject *ata_probe(dev_t dev, int *part, void *data) struct kobject *ata_probe(dev_t dev, int *part, void *data)
{ {
ide_hwif_t *hwif = data; ide_hwif_t *hwif = data;
...@@ -1154,7 +1156,7 @@ struct kobject *ata_probe(dev_t dev, int *part, void *data) ...@@ -1154,7 +1156,7 @@ struct kobject *ata_probe(dev_t dev, int *part, void *data)
ide_drive_t *drive = &hwif->drives[unit]; ide_drive_t *drive = &hwif->drives[unit];
if (!drive->present) if (!drive->present)
return NULL; return NULL;
if (!drive->driver) { if (drive->driver == &idedefault_driver) {
if (drive->media == ide_disk) if (drive->media == ide_disk)
(void) request_module("ide-disk"); (void) request_module("ide-disk");
if (drive->scsi) if (drive->scsi)
...@@ -1166,7 +1168,7 @@ struct kobject *ata_probe(dev_t dev, int *part, void *data) ...@@ -1166,7 +1168,7 @@ struct kobject *ata_probe(dev_t dev, int *part, void *data)
if (drive->media == ide_floppy) if (drive->media == ide_floppy)
(void) request_module("ide-floppy"); (void) request_module("ide-floppy");
} }
if (!drive->driver) if (drive->driver == &idedefault_driver)
return NULL; return NULL;
*part &= (1 << PARTN_BITS) - 1; *part &= (1 << PARTN_BITS) - 1;
return get_disk(drive->disk); return get_disk(drive->disk);
......
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