summaryrefslogtreecommitdiffstats
path: root/sys/dev/pccard
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2002-02-10 03:34:44 +0000
committerimp <imp@FreeBSD.org>2002-02-10 03:34:44 +0000
commit001b5dc57df902fe82dd56f44c6001250f8b1f02 (patch)
treecc3024d6f8a823986084dee85acb3cdd79a0c7d6 /sys/dev/pccard
parent196ad9781bd325a39fedee47eb36d252545e2599 (diff)
downloadFreeBSD-src-001b5dc57df902fe82dd56f44c6001250f8b1f02.zip
FreeBSD-src-001b5dc57df902fe82dd56f44c6001250f8b1f02.tar.gz
o Use bus_generic_setup_intr instead of bus_setup_intr.
o Call bus_generic_setup_intr and check its return value. Don't setup func until we successfully get the interrupt from our parent. o Add comments about some maybe questionable stuff so I can check later to make sure that it really is that way.
Diffstat (limited to 'sys/dev/pccard')
-rw-r--r--sys/dev/pccard/pccard.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/sys/dev/pccard/pccard.c b/sys/dev/pccard/pccard.c
index e4a2fb9..2b2ace4 100644
--- a/sys/dev/pccard/pccard.c
+++ b/sys/dev/pccard/pccard.c
@@ -1159,24 +1159,21 @@ pccard_setup_intr(device_t dev, device_t child, struct resource *irq,
{
struct pccard_ivar *ivar = PCCARD_IVAR(child);
struct pccard_function *func = ivar->fcn;
+ int err;
if (func->intr_handler != NULL)
panic("Only one interrupt handler per function allowed\n");
-
+ err = bus_generic_setup_intr(dev, child, irq, flags, pccard_intr,
+ func, cookiep);
+ if (err != 0)
+ return (err);
func->intr_handler = intr;
func->intr_handler_arg = arg;
func->intr_handler_cookie = *cookiep;
+ /* XXX Not sure this is right to write to ccr */
pccard_ccr_write(func, PCCARD_CCR_OPTION,
pccard_ccr_read(func, PCCARD_CCR_OPTION) |
PCCARD_CCR_OPTION_IREQ_ENABLE);
-
- /*
- * XXX Don't use TTY type for our interrupt handler. It makes
- * the spl masks wrong on -stable. Instead, we should use the type
- * that was requested of us.
- */
- bus_setup_intr(dev, irq, INTR_TYPE_TTY/* | INTR_FAST*/,
- pccard_intr, func, cookiep);
return (0);
}
@@ -1188,11 +1185,11 @@ pccard_teardown_intr(device_t dev, device_t child, struct resource *r,
struct pccard_function *func = ivar->fcn;
int ret;
+ /* XXX Not sure this is right to write to ccr */
pccard_ccr_write(func, PCCARD_CCR_OPTION,
pccard_ccr_read(func, PCCARD_CCR_OPTION) &
~PCCARD_CCR_OPTION_IREQ_ENABLE);
-
- ret = bus_teardown_intr(dev, r, cookie);
+ ret = bus_generic_teardown_intr(dev, child, r, cookie);
if (ret == 0) {
func->intr_handler = NULL;
func->intr_handler_arg = NULL;
OpenPOWER on IntegriCloud