From 62ea21cbc328eeccc8fc797c65dabce0459a2f32 Mon Sep 17 00:00:00 2001 From: Alexander Viro Date: Sat, 7 Sep 2002 03:04:20 -0700 Subject: [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].. Added a new variable - current_drive. Said animal is equal to D_S + d - it's reassigned at the same place as d. --- drivers/cdrom/sbpcd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/cdrom') 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; -- cgit v1.2.3