X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Facorn%2Fblock%2Ffd1772.c;h=674bf81c6e660040ab8d0136ecebd4e9f84aad66;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=0e7a399d2470e69f015351408cfc63986ef521ef;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/drivers/acorn/block/fd1772.c b/drivers/acorn/block/fd1772.c index 0e7a399d2..674bf81c6 100644 --- a/drivers/acorn/block/fd1772.c +++ b/drivers/acorn/block/fd1772.c @@ -138,9 +138,9 @@ #include #include #include +#include #include -#include #include #include #include @@ -376,19 +376,15 @@ static void do_fd_request(request_queue_t *); /************************* End of Prototypes **************************/ -static struct timer_list motor_off_timer = - TIMER_INITIALIZER(fd_motor_off_timer, 0, 0); +static DEFINE_TIMER(motor_off_timer, fd_motor_off_timer, 0, 0); #ifdef TRACKBUFFER -static struct timer_list readtrack_timer = - TIMER_INITIALIZER(fd_readtrack_check, 0, 0); +static DEFINE_TIMER(readtrack_timer, fd_readtrack_check, 0, 0); #endif -static struct timer_list timeout_timer = - TIMER_INITIALIZER(fd_times_out, 0, 0); +static DEFINE_TIMER(timeout_timer, fd_times_out, 0, 0); -static struct timer_list fd_timer = - TIMER_INITIALIZER(check_change, 0, 0); +static DEFINE_TIMER(fd_timer, check_change, 0, 0); /* DAG: Haven't got a clue what this is? */ int stdma_islocked(void) @@ -1283,8 +1279,7 @@ static void do_fd_request(request_queue_t* q) if (fdc_busy) return; save_flags(flags); cli(); - while (fdc_busy) - sleep_on(&fdc_wait); + wait_event(fdc_wait, !fdc_busy); fdc_busy = 1; ENABLE_IRQ(); restore_flags(flags); @@ -1522,7 +1517,7 @@ static struct kobject *floppy_find(dev_t dev, int *part, void *data) int fd1772_init(void) { - static spinlock_t lock = SPIN_LOCK_UNLOCKED; + static DEFINE_SPINLOCK(lock); int i, err = -ENOMEM; if (!machine_is_archimedes()) @@ -1554,12 +1549,12 @@ int fd1772_init(void) #ifdef TRACKBUFFER BufferDrive = BufferSide = BufferTrack = -1; /* Atari uses 512 - I want to eventually cope with 1K sectors */ - DMABuffer = (char *)kmalloc((FD1772_MAX_SECTORS+1)*512,GFP_KERNEL); + DMABuffer = kmalloc((FD1772_MAX_SECTORS+1)*512,GFP_KERNEL); TrackBuffer = DMABuffer + 512; #else /* Allocate memory for the DMAbuffer - on the Atari this takes it out of some special memory... */ - DMABuffer = (char *) kmalloc(2048); /* Copes with pretty large sectors */ + DMABuffer = kmalloc(2048); /* Copes with pretty large sectors */ #endif err = -ENOMEM; if (!DMAbuffer)