From owner-svn-src-head@freebsd.org Fri May 27 20:41:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 015E3B4D367; Fri, 27 May 2016 20:41:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7F251BE4; Fri, 27 May 2016 20:41:26 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4RKfQ0S045665; Fri, 27 May 2016 20:41:26 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4RKfPoe045663; Fri, 27 May 2016 20:41:25 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201605272041.u4RKfPoe045663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 27 May 2016 20:41:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300871 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2016 20:41:27 -0000 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);