Date: Fri, 27 May 2016 20:41:25 +0000 (UTC) From: Ian Lepore <ian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300871 - head/sys/dev/gpio Message-ID: <201605272041.u4RKfPoe045663@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ian Date: Fri May 27 20:41:25 2016 New Revision: 300871 URL: https://svnweb.freebsd.org/changeset/base/300871 Log: 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. Modified: head/sys/dev/gpio/gpiobus.c head/sys/dev/gpio/gpiobusvar.h Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Fri May 27 20:33:38 2016 (r300870) +++ head/sys/dev/gpio/gpiobus.c Fri May 27 20:41:25 2016 (r300871) @@ -96,6 +96,14 @@ gpio_alloc_intr_resource(device_t consum 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 Modified: head/sys/dev/gpio/gpiobusvar.h ============================================================================== --- head/sys/dev/gpio/gpiobusvar.h Fri May 27 20:33:38 2016 (r300870) +++ head/sys/dev/gpio/gpiobusvar.h Fri May 27 20:41:25 2016 (r300871) @@ -128,10 +128,8 @@ int gpio_pin_is_active(gpio_pin_t pin, b 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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605272041.u4RKfPoe045663>