Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 254645
b: refs/heads/master
c: c4b0afe
h: refs/heads/master
i:
  254643: b1f4740
v: v3
  • Loading branch information
Jarod Wilson authored and Mauro Carvalho Chehab committed Jul 1, 2011
1 parent 5db2605 commit 6ee1229
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6a8c97ac92461ec57e36b10572e78d4221e8faa8
refs/heads/master: c4b0afee3c1730cf9b0f6ad21729928d23d3918e
44 changes: 21 additions & 23 deletions trunk/drivers/staging/lirc/lirc_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,23 @@ static int hardware_init_port(void)

static int init_port(void)
{
int i, nlow, nhigh;
int i, nlow, nhigh, result;

result = request_irq(irq, irq_handler,
IRQF_DISABLED | (share_irq ? IRQF_SHARED : 0),
LIRC_DRIVER_NAME, (void *)&hardware);

switch (result) {
case -EBUSY:
printk(KERN_ERR LIRC_DRIVER_NAME ": IRQ %d busy\n", irq);
return -EBUSY;
case -EINVAL:
printk(KERN_ERR LIRC_DRIVER_NAME
": Bad irq number or handler\n");
return -EINVAL;
default:
break;
};

/* Reserve io region. */
/*
Expand Down Expand Up @@ -893,34 +909,17 @@ static int init_port(void)
printk(KERN_INFO LIRC_DRIVER_NAME ": Manually using active "
"%s receiver\n", sense ? "low" : "high");

dprintk("Interrupt %d, port %04x obtained\n", irq, io);
return 0;
}

static int set_use_inc(void *data)
{
int result;
unsigned long flags;

/* initialize timestamp */
do_gettimeofday(&lasttv);

result = request_irq(irq, irq_handler,
IRQF_DISABLED | (share_irq ? IRQF_SHARED : 0),
LIRC_DRIVER_NAME, (void *)&hardware);

switch (result) {
case -EBUSY:
printk(KERN_ERR LIRC_DRIVER_NAME ": IRQ %d busy\n", irq);
return -EBUSY;
case -EINVAL:
printk(KERN_ERR LIRC_DRIVER_NAME
": Bad irq number or handler\n");
return -EINVAL;
default:
dprintk("Interrupt %d, port %04x obtained\n", irq, io);
break;
}

spin_lock_irqsave(&hardware[type].lock, flags);

/* Set DLAB 0. */
Expand All @@ -945,10 +944,6 @@ static void set_use_dec(void *data)
soutp(UART_IER, sinp(UART_IER) &
(~(UART_IER_MSI|UART_IER_RLSI|UART_IER_THRI|UART_IER_RDI)));
spin_unlock_irqrestore(&hardware[type].lock, flags);

free_irq(irq, (void *)&hardware);

dprintk("freed IRQ %d\n", irq);
}

static ssize_t lirc_write(struct file *file, const char *buf,
Expand Down Expand Up @@ -1256,6 +1251,9 @@ static int __init lirc_serial_init_module(void)
static void __exit lirc_serial_exit_module(void)
{
lirc_serial_exit();

free_irq(irq, (void *)&hardware);

if (iommap != 0)
release_mem_region(iommap, 8 << ioshift);
else
Expand Down

0 comments on commit 6ee1229

Please sign in to comment.