Commit 62ea21cb authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[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.
parent 6f14c533
...@@ -625,7 +625,7 @@ static u_char drv_pattern[NR_SBPCD]={speed_auto,speed_auto,speed_auto,speed_auto ...@@ -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 int d; /* DriveStruct index: drive number */
static struct { static struct sbpcd_drive {
char drv_id; /* "jumpered" drive ID or -1 */ char drv_id; /* "jumpered" drive ID or -1 */
char drv_sel; /* drive select lines bits */ char drv_sel; /* drive select lines bits */
...@@ -728,6 +728,8 @@ static struct { ...@@ -728,6 +728,8 @@ static struct {
} D_S[NR_SBPCD]; } D_S[NR_SBPCD];
static struct sbpcd_drive *current_drive = D_S;
/* /*
* drive space ends here (needed separate for each unit) * drive space ends here (needed separate for each unit)
*/ */
...@@ -3579,6 +3581,7 @@ static int __init check_version(void) ...@@ -3579,6 +3581,7 @@ static int __init check_version(void)
static void switch_drive(int i) static void switch_drive(int i)
{ {
d=i; d=i;
current_drive = D_S + i;
OUT(CDo_enable,D_S[d].drv_sel); OUT(CDo_enable,D_S[d].drv_sel);
msg(DBG_DID,"drive %d (ID=%d) activated.\n", i, D_S[d].drv_id); msg(DBG_DID,"drive %d (ID=%d) activated.\n", i, D_S[d].drv_id);
return; return;
......
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