Check the return value of BUS_SETUP_INTR()
Reviewed by: imp
This commit is contained in:
+6
-2
@@ -367,11 +367,15 @@ at91_setup_intr(device_t dev, device_t child,
|
||||
driver_intr_t *intr, void *arg, void **cookiep)
|
||||
{
|
||||
struct at91_softc *sc = device_get_softc(dev);
|
||||
int error;
|
||||
|
||||
if (rman_get_start(ires) == sc->sc_irq_system && filt == NULL)
|
||||
panic("All system interrupt ISRs must be FILTER");
|
||||
BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, filt,
|
||||
intr, arg, cookiep);
|
||||
error = BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags,
|
||||
filt, intr, arg, cookiep);
|
||||
if (error)
|
||||
return (error);
|
||||
|
||||
bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_IECR,
|
||||
1 << rman_get_start(ires));
|
||||
return (0);
|
||||
|
||||
@@ -592,12 +592,15 @@ econa_setup_intr(device_t dev, device_t child,
|
||||
struct resource *ires, int flags, driver_filter_t *filt,
|
||||
driver_intr_t *intr, void *arg, void **cookiep)
|
||||
{
|
||||
int error;
|
||||
|
||||
if (rman_get_start(ires) == ECONA_IRQ_SYSTEM && filt == NULL)
|
||||
panic("All system interrupt ISRs must be FILTER");
|
||||
|
||||
BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, filt,
|
||||
intr, arg, cookiep);
|
||||
error = BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags,
|
||||
filt, intr, arg, cookiep);
|
||||
if (error)
|
||||
return (error);
|
||||
|
||||
arm_unmask_irq(rman_get_start(ires));
|
||||
|
||||
|
||||
@@ -354,8 +354,12 @@ iq80321_setup_intr(device_t dev, device_t child,
|
||||
struct resource *ires, int flags, driver_filter_t *filt,
|
||||
driver_intr_t *intr, void *arg, void **cookiep)
|
||||
{
|
||||
BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, filt, intr,
|
||||
arg, cookiep);
|
||||
int error;
|
||||
|
||||
error = BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags,
|
||||
filt, intr, arg, cookiep);
|
||||
if (error)
|
||||
return (error);
|
||||
intr_enabled |= 1 << rman_get_start(ires);
|
||||
i80321_set_intrmask();
|
||||
|
||||
|
||||
@@ -429,10 +429,12 @@ i81342_setup_intr(device_t dev, device_t child, struct resource *ires,
|
||||
int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg,
|
||||
void **cookiep)
|
||||
{
|
||||
|
||||
int error;
|
||||
|
||||
BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, filt, intr,
|
||||
arg, cookiep);
|
||||
error = BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags,
|
||||
filt, intr, arg, cookiep);
|
||||
if (error)
|
||||
return (error);
|
||||
arm_unmask_irq(rman_get_start(ires));
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -639,9 +639,12 @@ ixp425_setup_intr(device_t dev, device_t child,
|
||||
driver_intr_t *intr, void *arg, void **cookiep)
|
||||
{
|
||||
uint32_t mask, mask2;
|
||||
int error;
|
||||
|
||||
BUS_SETUP_INTR(device_get_parent(dev), child, res, flags, filt, intr,
|
||||
arg, cookiep);
|
||||
error = BUS_SETUP_INTR(device_get_parent(dev), child, res, flags,
|
||||
filt, intr, arg, cookiep);
|
||||
if (error)
|
||||
return (error);
|
||||
|
||||
get_masks(res, &mask, &mask2);
|
||||
update_masks(intr_enabled | mask, intr_enabled2 | mask2);
|
||||
|
||||
@@ -173,11 +173,14 @@ pxa_setup_intr(device_t dev, device_t child, struct resource *irq, int flags,
|
||||
driver_filter_t *filter, driver_intr_t *ithread, void *arg, void **cookiep)
|
||||
{
|
||||
struct obio_softc *sc;
|
||||
int error;
|
||||
|
||||
sc = (struct obio_softc *)device_get_softc(dev);
|
||||
|
||||
BUS_SETUP_INTR(device_get_parent(dev), child, irq, flags, filter,
|
||||
ithread, arg, cookiep);
|
||||
error = BUS_SETUP_INTR(device_get_parent(dev), child, irq, flags,
|
||||
filter, ithread, arg, cookiep);
|
||||
if (error)
|
||||
return (error);
|
||||
arm_unmask_irq(rman_get_start(irq));
|
||||
return (0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user