Don't wrap the declaration of gpio_alloc_intr_resource() in #ifdef INTRNG,

wrap the implementation so that it returns an error if INTRNG support is
not available.  It should be possible to write a non-INTRNG implementation
of this function some day.  In the meantime, there is code that contains
calls to this function (so the decl is needed), but have runtime checks to
avoid calling it in the non-INTRNG case.
This commit is contained in:
ian 2016-05-27 20:41:25 +00:00
parent 0dd69e35ff
commit 3cba38f109
2 changed files with 8 additions and 2 deletions

@ -96,6 +96,14 @@ gpio_alloc_intr_resource(device_t consumer_dev, int *rid, u_int alloc_flags,
return (bus_alloc_resource(consumer_dev, SYS_RES_IRQ, rid,
irqnum, irqnum, 1, alloc_flags));
}
#else
struct resource *
gpio_alloc_intr_resource(device_t consumer_dev, int *rid, u_int alloc_flags,
gpio_pin_t pin, uint32_t intr_mode)
{
return (NULL);
}
#endif
int

@ -128,10 +128,8 @@ int gpio_pin_is_active(gpio_pin_t pin, bool *active);
int gpio_pin_set_active(gpio_pin_t pin, bool active);
int gpio_pin_setflags(gpio_pin_t pin, uint32_t flags);
#endif
#ifdef INTRNG
struct resource *gpio_alloc_intr_resource(device_t consumer_dev, int *rid,
u_int alloc_flags, gpio_pin_t pin, uint32_t intr_mode);
#endif
int gpio_check_flags(uint32_t, uint32_t);
device_t gpiobus_attach_bus(device_t);
int gpiobus_detach_bus(device_t);