diff options
author | Michal Meloun <mmel@FreeBSD.org> | 2016-04-28 12:04:12 +0000 |
---|---|---|
committer | Michal Meloun <mmel@FreeBSD.org> | 2016-04-28 12:04:12 +0000 |
commit | 8442087f1512274ff2848307eff17b17ccdffe85 (patch) | |
tree | d2789a2a68c922e7fc80261b753e508c5ce2323d | |
parent | 39f6c1bdf48ae6a4e1e13d762d88e4ad431fc18c (diff) | |
download | src-8442087f1512274ff2848307eff17b17ccdffe85.tar.gz src-8442087f1512274ff2848307eff17b17ccdffe85.zip |
Notes
-rw-r--r-- | sys/dev/gpio/gpiobus.c | 2 | ||||
-rw-r--r-- | sys/kern/subr_intr.c | 14 | ||||
-rw-r--r-- | sys/sys/intr.h | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/sys/dev/gpio/gpiobus.c b/sys/dev/gpio/gpiobus.c index f2780217a5c9..b26a741df31a 100644 --- a/sys/dev/gpio/gpiobus.c +++ b/sys/dev/gpio/gpiobus.c @@ -90,7 +90,7 @@ gpio_alloc_intr_resource(device_t consumer_dev, int *rid, u_int alloc_flags, * into it. */ irqnum = intr_gpio_map_irq(pin->dev, pin->pin, pin->flags, intr_mode); - if (irqnum == 0xFFFFFFFF) + if (irqnum == INTR_IRQ_INVALID) return (NULL); return (bus_alloc_resource(consumer_dev, SYS_RES_IRQ, rid, diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c index 718c8c98a64b..ca53d2d9a249 100644 --- a/sys/kern/subr_intr.c +++ b/sys/kern/subr_intr.c @@ -109,8 +109,6 @@ static struct mtx isrc_table_lock; static struct intr_irqsrc *irq_sources[NIRQ]; u_int irq_next_free; -#define IRQ_INVALID nitems(irq_sources) - /* * XXX - All stuff around struct intr_dev_data is considered as temporary * until better place for storing struct intr_map_data will be find. @@ -138,7 +136,7 @@ static struct intr_dev_data *intr_ddata_tab[2 * NIRQ]; static u_int intr_ddata_first_unused; #define IRQ_DDATA_BASE 10000 -CTASSERT(IRQ_DDATA_BASE > IRQ_INVALID); +CTASSERT(IRQ_DDATA_BASE > nitems(irq_sources)); #ifdef SMP static boolean_t irq_assign_cpu = FALSE; @@ -399,7 +397,7 @@ isrc_free_irq(struct intr_irqsrc *isrc) return (EINVAL); irq_sources[isrc->isrc_irq] = NULL; - isrc->isrc_irq = IRQ_INVALID; /* just to be safe */ + isrc->isrc_irq = INTR_IRQ_INVALID; /* just to be safe */ return (0); } @@ -427,7 +425,7 @@ intr_isrc_register(struct intr_irqsrc *isrc, device_t dev, u_int flags, bzero(isrc, sizeof(struct intr_irqsrc)); isrc->isrc_dev = dev; - isrc->isrc_irq = IRQ_INVALID; /* just to be safe */ + isrc->isrc_irq = INTR_IRQ_INVALID; /* just to be safe */ isrc->isrc_flags = flags; va_start(ap, fmt); @@ -560,7 +558,7 @@ intr_acpi_map_irq(device_t dev, u_int irq, enum intr_polarity pol, ddata = intr_ddata_alloc(0); if (ddata == NULL) - return (0xFFFFFFFF); /* no space left */ + return (INTR_IRQ_INVALID); /* no space left */ ddata->idd_dev = dev; ddata->idd_data.type = INTR_MAP_DATA_ACPI; @@ -585,7 +583,7 @@ intr_fdt_map_irq(phandle_t node, pcell_t *cells, u_int ncells) cellsize = ncells * sizeof(*cells); ddata = intr_ddata_alloc(cellsize); if (ddata == NULL) - return (0xFFFFFFFF); /* no space left */ + return (INTR_IRQ_INVALID); /* no space left */ ddata->idd_xref = (intptr_t)node; ddata->idd_data.type = INTR_MAP_DATA_FDT; @@ -607,7 +605,7 @@ intr_gpio_map_irq(device_t dev, u_int pin_num, u_int pin_flags, u_int intr_mode) ddata = intr_ddata_alloc(0); if (ddata == NULL) - return (0xFFFFFFFF); /* no space left */ + return (INTR_IRQ_INVALID); /* no space left */ ddata->idd_dev = dev; ddata->idd_data.type = INTR_MAP_DATA_GPIO; diff --git a/sys/sys/intr.h b/sys/sys/intr.h index 797572e83fee..7d309f5fc078 100644 --- a/sys/sys/intr.h +++ b/sys/sys/intr.h @@ -32,6 +32,8 @@ #include <sys/systm.h> +#define INTR_IRQ_INVALID 0xFFFFFFFF + enum intr_map_data_type { INTR_MAP_DATA_ACPI, INTR_MAP_DATA_FDT, |