Commit 3ab12a18 authored by Willy Tarreau's avatar Willy Tarreau Committed by Denis Efremov

floppy: cleanup: make need_more_output() 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-16-w@1wt.euSigned-off-by: default avatarWilly Tarreau <w@1wt.eu>
Signed-off-by: default avatarDenis Efremov <efremov@linux.com>
parent 96dad77a
...@@ -1184,9 +1184,9 @@ static int result(int fdc) ...@@ -1184,9 +1184,9 @@ static int result(int fdc)
#define MORE_OUTPUT -2 #define MORE_OUTPUT -2
/* does the fdc need more output? */ /* does the fdc need more output? */
static int need_more_output(void) static int need_more_output(int fdc)
{ {
int status = wait_til_ready(current_fdc); int status = wait_til_ready(fdc);
if (status < 0) if (status < 0)
return -1; return -1;
...@@ -1194,7 +1194,7 @@ static int need_more_output(void) ...@@ -1194,7 +1194,7 @@ static int need_more_output(void)
if (is_ready_state(status)) if (is_ready_state(status))
return MORE_OUTPUT; return MORE_OUTPUT;
return result(current_fdc); return result(fdc);
} }
/* Set perpendicular mode as required, based on data rate, if supported. /* Set perpendicular mode as required, based on data rate, if supported.
...@@ -1244,7 +1244,7 @@ static int fdc_configure(void) ...@@ -1244,7 +1244,7 @@ static int fdc_configure(void)
{ {
/* Turn on FIFO */ /* Turn on FIFO */
output_byte(current_fdc, FD_CONFIGURE); output_byte(current_fdc, FD_CONFIGURE);
if (need_more_output() != MORE_OUTPUT) if (need_more_output(current_fdc) != MORE_OUTPUT)
return 0; return 0;
output_byte(current_fdc, 0); output_byte(current_fdc, 0);
output_byte(current_fdc, 0x10 | (no_fifo & 0x20) | (fifo_depth & 0xf)); output_byte(current_fdc, 0x10 | (no_fifo & 0x20) | (fifo_depth & 0xf));
...@@ -1302,7 +1302,7 @@ static void fdc_specify(void) ...@@ -1302,7 +1302,7 @@ static void fdc_specify(void)
/* chose the default rate table, not the one /* chose the default rate table, not the one
* where 1 = 2 Mbps */ * where 1 = 2 Mbps */
output_byte(current_fdc, FD_DRIVESPEC); output_byte(current_fdc, FD_DRIVESPEC);
if (need_more_output() == MORE_OUTPUT) { if (need_more_output(current_fdc) == MORE_OUTPUT) {
output_byte(current_fdc, UNIT(current_drive)); output_byte(current_fdc, UNIT(current_drive));
output_byte(current_fdc, 0xc0); output_byte(current_fdc, 0xc0);
} }
...@@ -4324,7 +4324,7 @@ static char __init get_fdc_version(void) ...@@ -4324,7 +4324,7 @@ static char __init get_fdc_version(void)
} }
output_byte(current_fdc, FD_PERPENDICULAR); output_byte(current_fdc, FD_PERPENDICULAR);
if (need_more_output() == MORE_OUTPUT) { if (need_more_output(current_fdc) == MORE_OUTPUT) {
output_byte(current_fdc, 0); output_byte(current_fdc, 0);
} else { } else {
pr_info("FDC %d is an 82072A\n", current_fdc); pr_info("FDC %d is an 82072A\n", current_fdc);
......
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