diff options
| author | Adam J. Richter <adam@yggdrasil.com> | 2002-09-11 18:35:49 -0700 |
|---|---|---|
| committer | Jeff Dike <jdike@karaya.com> | 2002-09-11 18:35:49 -0700 |
| commit | 7fe2a2c5a29e65bd9622ef8d105178fb4e4c69f5 (patch) | |
| tree | 34721108358c83278760d90bcc1b9d3b57e851a7 | |
| parent | 0e9387ab91c5a93fff869a4f45f47c9a5c0b2129 (diff) | |
[PATCH] Building list of drives in right order
ata_attach in linux-2.5.34/drivers/ide/ide.c builds a list of
IDE drives that do not yet have a device driver bound to them, in case
ide-disk, ide-scsi, or whatever driver you want to use is not loaded
yet.
The problem was that ata_attach was adding to the head of
the list, so the list was being built in reverse order. So, if
you had two IDE disks, and ide-disk was a loadable module, the
devfs entries for the disks would be numbered in reverse (the
first disk would be /dev/discs/disc1, and the second would be
/dev/discs/disc0).
This fixes the problem by changing the relevant list_add to
list_add_tail. Incidentally, the generic code in drivers/base/ already
does it this way.
| -rw-r--r-- | drivers/ide/ide.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 491dcb73b61d..bea8ce459ecb 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c @@ -2457,7 +2457,7 @@ int ata_attach(ide_drive_t *drive) } spin_unlock(&drivers_lock); spin_lock(&drives_lock); - list_add(&drive->list, &ata_unused); + list_add_tail(&drive->list, &ata_unused); spin_unlock(&drives_lock); return 1; } |
