Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325241
b: refs/heads/master
c: 877adc4
h: refs/heads/master
i:
  325239: 281df4b
v: v3
  • Loading branch information
Jens Taprogge authored and Greg Kroah-Hartman committed Sep 12, 2012
1 parent 02df008 commit 9ae102f
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: ab0deffcb957d1e0bf8c7e1d6373b4e1587b8192
refs/heads/master: 877adc406cc7aeb9610f32535ed61c24ff01bfe2
44 changes: 21 additions & 23 deletions trunk/drivers/staging/ipack/bridges/tpci200.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,22 @@ static void tpci200_unregister(struct tpci200_board *tpci200)
}
}

static void tpci200_enable_irq(struct tpci200_board *tpci200,
int islot)
{
tpci200_set_mask(tpci200,
&tpci200->info->interface_regs->control[islot],
TPCI200_INT0_EN | TPCI200_INT1_EN);
}

static void tpci200_disable_irq(struct tpci200_board *tpci200,
int islot)
{
tpci200_clear_mask(tpci200,
&tpci200->info->interface_regs->control[islot],
TPCI200_INT0_EN | TPCI200_INT1_EN);
}

static irqreturn_t tpci200_slot_irq(struct slot_irq *slot_irq)
{
irqreturn_t ret;
Expand Down Expand Up @@ -141,9 +157,7 @@ static irqreturn_t tpci200_interrupt(int irq, void *dev_id)
dev_info(&tpci200->info->pdev->dev,
"No registered ISR for slot [%d:%d]!. IRQ will be disabled.\n",
tpci200->number, i);
tpci200_clear_mask(tpci200,
&tpci200->info->interface_regs->control[i],
TPCI200_INT0_EN | TPCI200_INT1_EN);
tpci200_disable_irq(tpci200, i);
}
}
rcu_read_unlock();
Expand Down Expand Up @@ -269,23 +283,6 @@ static int tpci200_register(struct tpci200_board *tpci200)
return res;
}

static int __tpci200_request_irq(struct tpci200_board *tpci200,
struct ipack_device *dev)
{
tpci200_set_mask(tpci200,
&tpci200->info->interface_regs->control[dev->slot],
TPCI200_INT0_EN | TPCI200_INT1_EN);
return 0;
}

static void __tpci200_free_irq(struct tpci200_board *tpci200,
struct ipack_device *dev)
{
tpci200_clear_mask(tpci200,
&tpci200->info->interface_regs->control[dev->slot],
TPCI200_INT0_EN | TPCI200_INT1_EN);
}

static int tpci200_free_irq(struct ipack_device *dev)
{
struct slot_irq *slot_irq;
Expand All @@ -303,8 +300,9 @@ static int tpci200_free_irq(struct ipack_device *dev)
return -EINVAL;
}

__tpci200_free_irq(tpci200, dev);
tpci200_disable_irq(tpci200, dev->slot);
slot_irq = tpci200->slots[dev->slot].irq;
/* uninstall handler */
RCU_INIT_POINTER(tpci200->slots[dev->slot].irq, NULL);
synchronize_rcu();
kfree(slot_irq);
Expand Down Expand Up @@ -453,7 +451,7 @@ static int tpci200_slot_map_space(struct ipack_device *dev,
static int tpci200_request_irq(struct ipack_device *dev, int vector,
int (*handler)(void *), void *arg)
{
int res;
int res = 0;
struct slot_irq *slot_irq;
struct tpci200_board *tpci200;

Expand Down Expand Up @@ -493,7 +491,7 @@ static int tpci200_request_irq(struct ipack_device *dev, int vector,
slot_irq->holder = dev;

rcu_assign_pointer(tpci200->slots[dev->slot].irq, slot_irq);
res = __tpci200_request_irq(tpci200, dev);
tpci200_enable_irq(tpci200, dev->slot);

out_unlock:
mutex_unlock(&tpci200->mutex);
Expand Down

0 comments on commit 9ae102f

Please sign in to comment.