diff options
| author | Alexander Viro <viro@math.psu.edu> | 2002-09-07 03:04:20 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-09-07 03:04:20 -0700 |
| commit | 62ea21cbc328eeccc8fc797c65dabce0459a2f32 (patch) | |
| tree | 28d35f4505da6af407b0beee475d292b016efcbd /drivers/cdrom | |
| parent | 6f14c53363eae6d26e163e0d39b904bb7b3f1cac (diff) | |
[PATCH] (13/25) sbpcd.c - beginning of cleanup
sbpcd.c - sigh... It used to have a global variable inventively called
'd'. Current disk number. Tons of uses, 99% of them being D_S[d].<blah>.
Added a new variable - current_drive. Said animal is equal to D_S + d -
it's reassigned at the same place as d.
Diffstat (limited to 'drivers/cdrom')
| -rw-r--r-- | drivers/cdrom/sbpcd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/cdrom/sbpcd.c b/drivers/cdrom/sbpcd.c index c822f2d3546e..50ffc0bf9eb0 100644 --- a/drivers/cdrom/sbpcd.c +++ b/drivers/cdrom/sbpcd.c @@ -625,7 +625,7 @@ static u_char drv_pattern[NR_SBPCD]={speed_auto,speed_auto,speed_auto,speed_auto */ static int d; /* DriveStruct index: drive number */ -static struct { +static struct sbpcd_drive { char drv_id; /* "jumpered" drive ID or -1 */ char drv_sel; /* drive select lines bits */ @@ -728,6 +728,8 @@ static struct { } D_S[NR_SBPCD]; +static struct sbpcd_drive *current_drive = D_S; + /* * drive space ends here (needed separate for each unit) */ @@ -3579,6 +3581,7 @@ static int __init check_version(void) static void switch_drive(int i) { d=i; + current_drive = D_S + i; OUT(CDo_enable,D_S[d].drv_sel); msg(DBG_DID,"drive %d (ID=%d) activated.\n", i, D_S[d].drv_id); return; |
