Commit c1f710b5 authored by Willy Tarreau's avatar Willy Tarreau Committed by Denis Efremov

floppy: cleanup: make twaddle() not rely on current_{fdc,drive} anymore

Now the fdc and drive are passed in argument so that the function does
not use current_fdc nor current_drive anymore.

Link: https://lore.kernel.org/r/20200331094054.24441-10-w@1wt.euSigned-off-by: default avatarWilly Tarreau <w@1wt.eu>
Signed-off-by: default avatarDenis Efremov <efremov@linux.com>
parent 38ede908
...@@ -827,14 +827,14 @@ static int set_dor(int fdc, char mask, char data) ...@@ -827,14 +827,14 @@ static int set_dor(int fdc, char mask, char data)
return olddor; return olddor;
} }
static void twaddle(void) static void twaddle(int fdc, int drive)
{ {
if (drive_params[current_drive].select_delay) if (drive_params[drive].select_delay)
return; return;
fdc_outb(fdc_state[current_fdc].dor & ~(0x10 << UNIT(current_drive)), fdc_outb(fdc_state[fdc].dor & ~(0x10 << UNIT(drive)),
current_fdc, FD_DOR); fdc, FD_DOR);
fdc_outb(fdc_state[current_fdc].dor, current_fdc, FD_DOR); fdc_outb(fdc_state[fdc].dor, fdc, FD_DOR);
drive_state[current_drive].select_date = jiffies; drive_state[drive].select_date = jiffies;
} }
/* /*
...@@ -1934,7 +1934,7 @@ static void floppy_ready(void) ...@@ -1934,7 +1934,7 @@ static void floppy_ready(void)
"calling disk change from floppy_ready\n"); "calling disk change from floppy_ready\n");
if (!(raw_cmd->flags & FD_RAW_NO_MOTOR) && if (!(raw_cmd->flags & FD_RAW_NO_MOTOR) &&
disk_change(current_drive) && !drive_params[current_drive].select_delay) disk_change(current_drive) && !drive_params[current_drive].select_delay)
twaddle(); /* this clears the dcl on certain twaddle(current_fdc, current_drive); /* this clears the dcl on certain
* drive/controller combinations */ * drive/controller combinations */
#ifdef fd_chose_dma_mode #ifdef fd_chose_dma_mode
...@@ -2904,7 +2904,7 @@ static void redo_fd_request(void) ...@@ -2904,7 +2904,7 @@ static void redo_fd_request(void)
} }
if (test_bit(FD_NEED_TWADDLE_BIT, &drive_state[current_drive].flags)) if (test_bit(FD_NEED_TWADDLE_BIT, &drive_state[current_drive].flags))
twaddle(); twaddle(current_fdc, current_drive);
schedule_bh(floppy_start); schedule_bh(floppy_start);
debugt(__func__, "queue fd request"); debugt(__func__, "queue fd request");
return; return;
...@@ -3610,7 +3610,7 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned int ...@@ -3610,7 +3610,7 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned int
case FDTWADDLE: case FDTWADDLE:
if (lock_fdc(drive)) if (lock_fdc(drive))
return -EINTR; return -EINTR;
twaddle(); twaddle(current_fdc, current_drive);
process_fd_request(); process_fd_request();
return 0; return 0;
default: default:
......
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