diff options
author | Nibble Max <nibble.max@gmail.com> | 2014-12-25 03:18:31 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-02-02 11:42:53 -0500 |
commit | ab98180ac2e6e41058f8829c0961aa306c610c16 (patch) | |
tree | 2581e19d47d011ec6d6bde49ef58c2122067bab4 | |
parent | 93d8db803a6477d3b075b971b10c2bb3ef164a44 (diff) |
[media] smipcie: return more proper value in interrupt handler
Although IRQ_HANDLED is "safe" value to return,
it is better to let the kernel know whether the driver handle the interrupt or not.
Signed-off-by: Nibble Max <nibble.max@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r-- | drivers/media/pci/smipcie/smipcie.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/media/pci/smipcie/smipcie.c b/drivers/media/pci/smipcie/smipcie.c index f773350e67b9..36c8ed77309c 100644 --- a/drivers/media/pci/smipcie/smipcie.c +++ b/drivers/media/pci/smipcie/smipcie.c | |||
@@ -448,16 +448,19 @@ static void smi_port_exit(struct smi_port *port) | |||
448 | port->enable = 0; | 448 | port->enable = 0; |
449 | } | 449 | } |
450 | 450 | ||
451 | static void smi_port_irq(struct smi_port *port, u32 int_status) | 451 | static int smi_port_irq(struct smi_port *port, u32 int_status) |
452 | { | 452 | { |
453 | u32 port_req_irq = port->_dmaInterruptCH0 | port->_dmaInterruptCH1; | 453 | u32 port_req_irq = port->_dmaInterruptCH0 | port->_dmaInterruptCH1; |
454 | int handled = 0; | ||
454 | 455 | ||
455 | if (int_status & port_req_irq) { | 456 | if (int_status & port_req_irq) { |
456 | smi_port_disableInterrupt(port); | 457 | smi_port_disableInterrupt(port); |
457 | port->_int_status = int_status; | 458 | port->_int_status = int_status; |
458 | smi_port_clearInterrupt(port); | 459 | smi_port_clearInterrupt(port); |
459 | tasklet_schedule(&port->tasklet); | 460 | tasklet_schedule(&port->tasklet); |
461 | handled = 1; | ||
460 | } | 462 | } |
463 | return handled; | ||
461 | } | 464 | } |
462 | 465 | ||
463 | static irqreturn_t smi_irq_handler(int irq, void *dev_id) | 466 | static irqreturn_t smi_irq_handler(int irq, void *dev_id) |
@@ -465,18 +468,19 @@ static irqreturn_t smi_irq_handler(int irq, void *dev_id) | |||
465 | struct smi_dev *dev = dev_id; | 468 | struct smi_dev *dev = dev_id; |
466 | struct smi_port *port0 = &dev->ts_port[0]; | 469 | struct smi_port *port0 = &dev->ts_port[0]; |
467 | struct smi_port *port1 = &dev->ts_port[1]; | 470 | struct smi_port *port1 = &dev->ts_port[1]; |
471 | int handled = 0; | ||
468 | 472 | ||
469 | u32 intr_status = smi_read(MSI_INT_STATUS); | 473 | u32 intr_status = smi_read(MSI_INT_STATUS); |
470 | 474 | ||
471 | /* ts0 interrupt.*/ | 475 | /* ts0 interrupt.*/ |
472 | if (dev->info->ts_0) | 476 | if (dev->info->ts_0) |
473 | smi_port_irq(port0, intr_status); | 477 | handled += smi_port_irq(port0, intr_status); |
474 | 478 | ||
475 | /* ts1 interrupt.*/ | 479 | /* ts1 interrupt.*/ |
476 | if (dev->info->ts_1) | 480 | if (dev->info->ts_1) |
477 | smi_port_irq(port1, intr_status); | 481 | handled += smi_port_irq(port1, intr_status); |
478 | 482 | ||
479 | return IRQ_HANDLED; | 483 | return IRQ_RETVAL(handled); |
480 | } | 484 | } |
481 | 485 | ||
482 | static struct i2c_client *smi_add_i2c_client(struct i2c_adapter *adapter, | 486 | static struct i2c_client *smi_add_i2c_client(struct i2c_adapter *adapter, |