X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fcdrom%2Fsonycd535.c;h=f77ada933ea0a89643d0efb4cf6953059aee9e49;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=a0c9c8d42cbb6b51d26e0acbd698595ab072219f;hpb=9213980e6a70d8473e0ffd4b39ab5b6caaba9ff5;p=linux-2.6.git diff --git a/drivers/cdrom/sonycd535.c b/drivers/cdrom/sonycd535.c index a0c9c8d42..f77ada933 100644 --- a/drivers/cdrom/sonycd535.c +++ b/drivers/cdrom/sonycd535.c @@ -210,7 +210,7 @@ static int do_sony_cmd(Byte * cmd, int nCmd, Byte status[2], /* The base I/O address of the Sony Interface. This is a variable (not a #define) so it can be easily changed via some future ioctl() */ static unsigned int sony535_cd_base_io = CDU535_ADDRESS; -MODULE_PARM(sony535_cd_base_io, "i"); +module_param(sony535_cd_base_io, int, 0); /* * The following are I/O addresses of the various registers for the drive. The @@ -222,7 +222,7 @@ static unsigned short command_reg; static unsigned short read_status_reg; static unsigned short data_reg; -static spinlock_t sonycd535_lock = SPIN_LOCK_UNLOCKED; /* queue lock */ +static DEFINE_SPINLOCK(sonycd535_lock); /* queue lock */ static struct request_queue *sonycd535_queue; static int initialized; /* Has the drive been initialized? */ @@ -322,7 +322,7 @@ disable_interrupts(void) } static irqreturn_t -cdu535_interrupt(int irq, void *dev_id, struct pt_regs *regs) +cdu535_interrupt(int irq, void *dev_id) { disable_interrupts(); if (waitqueue_active(&cdu535_irq_wait)) { @@ -1478,8 +1478,7 @@ static int __init sony535_init(void) /* look for the CD-ROM, follows the procedure in the DOS driver */ inb(select_unit_reg); /* wait for 40 18 Hz ticks (reverse-engineered from DOS driver) */ - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout((HZ+17)*40/18); + schedule_timeout_interruptible((HZ+17)*40/18); inb(result_reg); outb(0, read_status_reg); /* does a reset? */ @@ -1528,7 +1527,7 @@ static int __init sony535_init(void) } if (sony535_irq_used > 0) { if (request_irq(sony535_irq_used, cdu535_interrupt, - SA_INTERRUPT, CDU535_HANDLE, NULL)) { + IRQF_DISABLED, CDU535_HANDLE, NULL)) { printk("Unable to grab IRQ%d for the " CDU535_MESSAGE_NAME " driver; polling instead.\n", sony535_irq_used); sony535_irq_used = 0; @@ -1590,7 +1589,6 @@ static int __init sony535_init(void) cdu_disk->first_minor = 0; cdu_disk->fops = &cdu_fops; sprintf(cdu_disk->disk_name, "cdu"); - sprintf(cdu_disk->devfs_name, "cdu535"); if (!request_region(sony535_cd_base_io, 4, CDU535_HANDLE)) { printk(KERN_WARNING"sonycd535: Unable to request region 0x%x\n", @@ -1605,8 +1603,7 @@ out7: put_disk(cdu_disk); out6: for (i = 0; i < sony_buffer_sectors; i++) - if (sony_buffer[i]) - kfree(sony_buffer[i]); + kfree(sony_buffer[i]); out5: kfree(sony_buffer); out4: