Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 261859
b: refs/heads/master
c: 5c05a8d
h: refs/heads/master
i:
  261857: 78f026c
  261855: 309c8c5
v: v3
  • Loading branch information
Mark Brown authored and Samuel Ortiz committed Jul 31, 2011
1 parent 2374ce9 commit ab7621a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 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: b9d03d999b46f0897492f3aac3e794312e5282db
refs/heads/master: 5c05a8d1f0105ada3cb04be5b70686fc6b272619
18 changes: 13 additions & 5 deletions trunk/drivers/mfd/wm831x-irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,13 +527,22 @@ int wm831x_irq_init(struct wm831x *wm831x, int irq)
0xffff);
}

if (!pdata || !pdata->irq_base) {
dev_err(wm831x->dev,
"No interrupt base specified, no interrupts\n");
/* Try to dynamically allocate IRQs if no base is specified */
if (!pdata || !pdata->irq_base)
wm831x->irq_base = -1;
else
wm831x->irq_base = pdata->irq_base;

wm831x->irq_base = irq_alloc_descs(wm831x->irq_base, 0,
WM831X_NUM_IRQS, 0);
if (wm831x->irq_base < 0) {
dev_warn(wm831x->dev, "Failed to allocate IRQs: %d\n",
wm831x->irq_base);
wm831x->irq_base = 0;
return 0;
}

if (pdata->irq_cmos)
if (pdata && pdata->irq_cmos)
i = 0;
else
i = WM831X_IRQ_OD;
Expand All @@ -553,7 +562,6 @@ int wm831x_irq_init(struct wm831x *wm831x, int irq)
}

wm831x->irq = irq;
wm831x->irq_base = pdata->irq_base;

/* Register them with genirq */
for (cur_irq = wm831x->irq_base;
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/mfd/wm831x/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ struct wm831x {

int irq; /* Our chip IRQ */
struct mutex irq_lock;
unsigned int irq_base;
int irq_base;
int irq_masks_cur[WM831X_NUM_IRQ_REGS]; /* Currently active value */
int irq_masks_cache[WM831X_NUM_IRQ_REGS]; /* Cached hardware value */

Expand Down

0 comments on commit ab7621a

Please sign in to comment.