Commit 95c45597 authored by Linus Torvalds's avatar Linus Torvalds

Fix IDE init order dependency problem, noted by Jens Axboe.

This is pretty ugly, Al will fix up properly.
parent a3786fd8
......@@ -1526,7 +1526,19 @@ int ide_do_drive_cmd (ide_drive_t *drive, struct request *rq, ide_action_t actio
#endif
rq->errors = 0;
rq->rq_status = RQ_ACTIVE;
rq->rq_dev = mk_kdev(drive->disk->major, drive->disk->first_minor);
/*
* Aiee. This is ugly, but it gets called before "drive->disk"
* has been initialized. Al will fix it, I'm sure.
*/
if (drive->disk)
rq->rq_dev = mk_kdev(drive->disk->major, drive->disk->first_minor);
else {
printk("IDE init is ugly:");
dump_stack();
rq->rq_dev = mk_kdev(HWIF(drive)->major, (drive->select.b.unit) << PARTN_BITS);
}
rq->rq_disk = drive->disk;
if (action == ide_wait)
rq->waiting = &wait;
......
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