Sun Mar 28 20:40:30 2021 UTC ()
No need to pass interface attribute or locators to config_search().


(thorpej)
diff -r1.64.10.4 -r1.64.10.5 src/sys/dev/gpio/gpio.c

cvs diff -r1.64.10.4 -r1.64.10.5 src/sys/dev/gpio/gpio.c (expand / switch to unified diff)

--- src/sys/dev/gpio/gpio.c 2021/03/21 18:03:32 1.64.10.4
+++ src/sys/dev/gpio/gpio.c 2021/03/28 20:40:30 1.64.10.5
@@ -1,35 +1,35 @@ @@ -1,35 +1,35 @@
1/* $NetBSD: gpio.c,v 1.64.10.4 2021/03/21 18:03:32 thorpej Exp $ */ 1/* $NetBSD: gpio.c,v 1.64.10.5 2021/03/28 20:40:30 thorpej Exp $ */
2/* $OpenBSD: gpio.c,v 1.6 2006/01/14 12:33:49 grange Exp $ */ 2/* $OpenBSD: gpio.c,v 1.6 2006/01/14 12:33:49 grange Exp $ */
3 3
4/* 4/*
5 * Copyright (c) 2008, 2009, 2010, 2011 Marc Balmer <marc@msys.ch> 5 * Copyright (c) 2008, 2009, 2010, 2011 Marc Balmer <marc@msys.ch>
6 * Copyright (c) 2004, 2006 Alexander Yurchenko <grange@openbsd.org> 6 * Copyright (c) 2004, 2006 Alexander Yurchenko <grange@openbsd.org>
7 * 7 *
8 * Permission to use, copy, modify, and distribute this software for any 8 * Permission to use, copy, modify, and distribute this software for any
9 * purpose with or without fee is hereby granted, provided that the above 9 * purpose with or without fee is hereby granted, provided that the above
10 * copyright notice and this permission notice appear in all copies. 10 * copyright notice and this permission notice appear in all copies.
11 * 11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 13 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 14 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 15 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 */ 19 */
20 20
21#include <sys/cdefs.h> 21#include <sys/cdefs.h>
22__KERNEL_RCSID(0, "$NetBSD: gpio.c,v 1.64.10.4 2021/03/21 18:03:32 thorpej Exp $"); 22__KERNEL_RCSID(0, "$NetBSD: gpio.c,v 1.64.10.5 2021/03/28 20:40:30 thorpej Exp $");
23 23
24/* 24/*
25 * General Purpose Input/Output framework. 25 * General Purpose Input/Output framework.
26 */ 26 */
27 27
28#include <sys/param.h> 28#include <sys/param.h>
29#include <sys/callout.h> 29#include <sys/callout.h>
30#include <sys/systm.h> 30#include <sys/systm.h>
31#include <sys/conf.h> 31#include <sys/conf.h>
32#include <sys/device.h> 32#include <sys/device.h>
33#include <sys/fcntl.h> 33#include <sys/fcntl.h>
34#include <sys/ioctl.h> 34#include <sys/ioctl.h>
35#include <sys/gpio.h> 35#include <sys/gpio.h>
@@ -182,28 +182,26 @@ gpio_childdetached(device_t self, device @@ -182,28 +182,26 @@ gpio_childdetached(device_t self, device
182 mutex_enter(&sc->sc_mtx); 182 mutex_enter(&sc->sc_mtx);
183 sc->sc_attach_busy = 0; 183 sc->sc_attach_busy = 0;
184 cv_signal(&sc->sc_attach); 184 cv_signal(&sc->sc_attach);
185 mutex_exit(&sc->sc_mtx); 185 mutex_exit(&sc->sc_mtx);
186#endif 186#endif
187} 187}
188 188
189static int 189static int
190gpio_rescan(device_t self, const char *ifattr, const int *locators) 190gpio_rescan(device_t self, const char *ifattr, const int *locators)
191{ 191{
192 192
193 config_search(self, NULL, 193 config_search(self, NULL,
194 CFARG_SUBMATCH, gpio_search, 194 CFARG_SUBMATCH, gpio_search,
195 CFARG_IATTR, ifattr, 
196 CFARG_LOCATORS, locators, 
197 CFARG_EOL); 195 CFARG_EOL);
198 196
199 return 0; 197 return 0;
200} 198}
201 199
202static void 200static void
203gpio_attach(device_t parent, device_t self, void *aux) 201gpio_attach(device_t parent, device_t self, void *aux)
204{ 202{
205 struct gpio_softc *sc = device_private(self); 203 struct gpio_softc *sc = device_private(self);
206 struct gpiobus_attach_args *gba = aux; 204 struct gpiobus_attach_args *gba = aux;
207 struct gpio_name *nm; 205 struct gpio_name *nm;
208 int pin; 206 int pin;
209 207