#define lock_fdc(drive, interruptible) \
_lock_fdc(drive, interruptible, __LINE__)
-#define LOCK_FDC(drive, interruptible) \
- if (lock_fdc(drive, interruptible)) \
- return -EINTR;
-
/* unlocks the driver */
static inline void unlock_fdc(void)
{
{
int ret;
- LOCK_FDC(drive, 1);
+ if (lock_fdc(drive, 1))
+ return -EINTR;
+
set_floppy(drive);
if (!_floppy ||
_floppy->track > DP->tracks ||
{
int ret;
- ret = 0;
- LOCK_FDC(drive, interruptible);
+ if (lock_fdc(drive, interruptible))
+ return -EINTR;
+
if (arg == FD_RESET_ALWAYS)
FDCS->reset = 1;
if (FDCS->reset) {
WAIT(reset_fdc);
}
process_fd_request();
- return ret;
+ return 0;
}
/*
mutex_unlock(&open_lock);
} else {
int oldStretch;
- LOCK_FDC(drive, 1);
+
+ if (lock_fdc(drive, 1))
+ return -EINTR;
if (cmd != FDDEFPRM)
/* notice a disk change immediately, else
* we lose our settings immediately*/
if (type)
*g = &floppy_type[type];
else {
- LOCK_FDC(drive, 0);
+ if (lock_fdc(drive, 0))
+ return -EINTR;
CALL(poll_drive(0, 0));
process_fd_request();
*g = current_type[drive];
if (UDRS->fd_ref != 1)
/* somebody else has this drive open */
return -EBUSY;
- LOCK_FDC(drive, 1);
+ if (lock_fdc(drive, 1))
+ return -EINTR;
/* do the actual eject. Fails on
* non-Sparc architectures */
process_fd_request();
return ret;
case FDCLRPRM:
- LOCK_FDC(drive, 1);
+ if (lock_fdc(drive, 1))
+ return -EINTR;
current_type[drive] = NULL;
floppy_sizes[drive] = MAX_DISK_SIZE << 1;
UDRS->keep_data = 0;
UDP->flags &= ~FTD_MSG;
return 0;
case FDFMTBEG:
- LOCK_FDC(drive, 1);
+ if (lock_fdc(drive, 1))
+ return -EINTR;
CALL(poll_drive(1, FD_RAW_NEED_DISK));
ret = UDRS->flags;
process_fd_request();
return do_format(drive, &inparam.f);
case FDFMTEND:
case FDFLUSH:
- LOCK_FDC(drive, 1);
+ if (lock_fdc(drive, 1))
+ return -EINTR;
return invalidate_drive(bdev);
case FDSETEMSGTRESH:
UDP->max_errors.reporting = (unsigned short)(param & 0x0f);
outparam = (const char *)UDP;
break;
case FDPOLLDRVSTAT:
- LOCK_FDC(drive, 1);
+ if (lock_fdc(drive, 1))
+ return -EINTR;
CALL(poll_drive(1, FD_RAW_NEED_DISK));
process_fd_request();
/* fall through */
case FDRAWCMD:
if (type)
return -EINVAL;
- LOCK_FDC(drive, 1);
+ if (lock_fdc(drive, 1))
+ return -EINTR;
set_floppy(drive);
CALL(i = raw_cmd_ioctl(cmd, (void __user *)param));
process_fd_request();
return i;
case FDTWADDLE:
- LOCK_FDC(drive, 1);
+ if (lock_fdc(drive, 1))
+ return -EINTR;
twaddle();
process_fd_request();
return 0;