summaryrefslogtreecommitdiff
path: root/drivers/block/floppy.c
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2020-03-31 11:40:43 +0200
committerDenis Efremov <efremov@linux.com>2020-05-12 19:34:54 +0300
commit5ea00bfc52f428cab828623e2d7084118c25d54b (patch)
tree19b209330d0dcca7a41209eb40fb2d19064e89a4 /drivers/block/floppy.c
parent6d494ed03766ead1b180463380511fed9ac779d9 (diff)
floppy: cleanup: make wait_til_ready() not rely on current_fdc anymore
Now the fdc is passed in argument so that the function does not use current_fdc anymore. Link: https://lore.kernel.org/r/20200331094054.24441-13-w@1wt.eu Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Denis Efremov <efremov@linux.com>
Diffstat (limited to 'drivers/block/floppy.c')
-rw-r--r--drivers/block/floppy.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index dd739594fce7..5dfddd4726fb 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -1107,30 +1107,30 @@ static void setup_DMA(void)
static void show_floppy(int fdc);
/* waits until the fdc becomes ready */
-static int wait_til_ready(void)
+static int wait_til_ready(int fdc)
{
int status;
int counter;
- if (fdc_state[current_fdc].reset)
+ if (fdc_state[fdc].reset)
return -1;
for (counter = 0; counter < 10000; counter++) {
- status = fdc_inb(current_fdc, FD_STATUS);
+ status = fdc_inb(fdc, FD_STATUS);
if (status & STATUS_READY)
return status;
}
if (initialized) {
- DPRINT("Getstatus times out (%x) on fdc %d\n", status, current_fdc);
- show_floppy(current_fdc);
+ DPRINT("Getstatus times out (%x) on fdc %d\n", status, fdc);
+ show_floppy(fdc);
}
- fdc_state[current_fdc].reset = 1;
+ fdc_state[fdc].reset = 1;
return -1;
}
/* sends a command byte to the fdc */
static int output_byte(char byte)
{
- int status = wait_til_ready();
+ int status = wait_til_ready(current_fdc);
if (status < 0)
return -1;
@@ -1159,7 +1159,7 @@ static int result(void)
int status = 0;
for (i = 0; i < MAX_REPLIES; i++) {
- status = wait_til_ready();
+ status = wait_til_ready(current_fdc);
if (status < 0)
break;
status &= STATUS_DIR | STATUS_READY | STATUS_BUSY | STATUS_DMA;
@@ -1186,7 +1186,7 @@ static int result(void)
/* does the fdc need more output? */
static int need_more_output(void)
{
- int status = wait_til_ready();
+ int status = wait_til_ready(current_fdc);
if (status < 0)
return -1;