summaryrefslogtreecommitdiff
path: root/sys/dev/sun
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>2021-04-24 23:36:23 +0000
committerthorpej <thorpej@NetBSD.org>2021-04-24 23:36:23 +0000
commit3bee0c110b9ff2a9a0e2833be339e1c873af3a44 (patch)
tree82c9f34b9867882723e76eff95e5d7ca6cab69bf /sys/dev/sun
parente77b3a7c4b6598de68d8b78f86e7851410840595 (diff)
Merge thorpej-cfargs branch:
Simplify and make extensible the config_search() / config_found() / config_attach() interfaces: rather than having different variants for which arguments you want pass along, just have a single call that takes a variadic list of tag-value arguments. Adjust all call sites: - Simplify wherever possible; don't pass along arguments that aren't actually needed. - Don't be explicit about what interface attribute is attaching if the device only has one. (More simplification.) - Add a config_probe() function to be used in indirect configuiration situations, making is visibly easier to see when indirect config is in play, and allowing for future change in semantics. (As of now, this is just a wrapper around config_match(), but that is an implementation detail.) Remove unnecessary or redundant interface attributes where they're not needed. There are currently 5 "cfargs" defined: - CFARG_SUBMATCH (submatch function for direct config) - CFARG_SEARCH (search function for indirect config) - CFARG_IATTR (interface attribte) - CFARG_LOCATORS (locators array) - CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles) ...and a sentinel value CFARG_EOL. Add some extra sanity checking to ensure that interface attributes aren't ambiguous. Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark ports to associate those device handles with device_t instance. This will trickle trough to more places over time (need back-end for pre-OFW Sun OBP; any others?).
Diffstat (limited to 'sys/dev/sun')
-rw-r--r--sys/dev/sun/bwtwo.c6
-rw-r--r--sys/dev/sun/cgsix.c6
-rw-r--r--sys/dev/sun/cgthree.c6
-rw-r--r--sys/dev/sun/kbd.c6
-rw-r--r--sys/dev/sun/sunms.c6
5 files changed, 15 insertions, 15 deletions
diff --git a/sys/dev/sun/bwtwo.c b/sys/dev/sun/bwtwo.c
index 76d6add2b6c..d5f0e52d7d3 100644
--- a/sys/dev/sun/bwtwo.c
+++ b/sys/dev/sun/bwtwo.c
@@ -1,4 +1,4 @@
-/* $NetBSD: bwtwo.c,v 1.36 2019/01/21 06:23:17 macallan Exp $ */
+/* $NetBSD: bwtwo.c,v 1.37 2021/04/24 23:36:59 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bwtwo.c,v 1.36 2019/01/21 06:23:17 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bwtwo.c,v 1.37 2021/04/24 23:36:59 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -324,7 +324,7 @@ bwtwoattach(struct bwtwo_softc *sc, const char *name, int isconsole)
aa.console = isconsole;
aa.accessops = &bwtwo_accessops;
aa.accesscookie = &sc->vd;
- config_found(sc->sc_dev, &aa, wsemuldisplaydevprint);
+ config_found(sc->sc_dev, &aa, wsemuldisplaydevprint, CFARG_EOL);
#endif
}
diff --git a/sys/dev/sun/cgsix.c b/sys/dev/sun/cgsix.c
index d092d73be56..f506930791c 100644
--- a/sys/dev/sun/cgsix.c
+++ b/sys/dev/sun/cgsix.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cgsix.c,v 1.68 2019/01/19 00:16:43 macallan Exp $ */
+/* $NetBSD: cgsix.c,v 1.69 2021/04/24 23:36:59 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cgsix.c,v 1.68 2019/01/19 00:16:43 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgsix.c,v 1.69 2021/04/24 23:36:59 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -629,7 +629,7 @@ cg6attach(struct cgsix_softc *sc, const char *name, int isconsole)
aa.console = isconsole;
aa.accessops = &cgsix_accessops;
aa.accesscookie = &sc->vd;
- config_found(sc->sc_dev, &aa, wsemuldisplaydevprint);
+ config_found(sc->sc_dev, &aa, wsemuldisplaydevprint, CFARG_EOL);
}
diff --git a/sys/dev/sun/cgthree.c b/sys/dev/sun/cgthree.c
index a54e2cbff26..39440141b3a 100644
--- a/sys/dev/sun/cgthree.c
+++ b/sys/dev/sun/cgthree.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cgthree.c,v 1.33 2016/11/09 19:54:25 macallan Exp $ */
+/* $NetBSD: cgthree.c,v 1.34 2021/04/24 23:36:59 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cgthree.c,v 1.33 2016/11/09 19:54:25 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgthree.c,v 1.34 2021/04/24 23:36:59 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -244,7 +244,7 @@ cgthreeattach(struct cgthree_softc *sc, const char *name, int isconsole)
aa.console = isconsole;
aa.accessops = &cgthree_accessops;
aa.accesscookie = &sc->vd;
- config_found(sc->sc_dev, &aa, wsemuldisplaydevprint);
+ config_found(sc->sc_dev, &aa, wsemuldisplaydevprint, CFARG_EOL);
}
diff --git a/sys/dev/sun/kbd.c b/sys/dev/sun/kbd.c
index 79740fd7cc1..b90fa8cc4db 100644
--- a/sys/dev/sun/kbd.c
+++ b/sys/dev/sun/kbd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: kbd.c,v 1.71 2020/01/18 21:08:42 tsutsui Exp $ */
+/* $NetBSD: kbd.c,v 1.72 2021/04/24 23:36:59 thorpej Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -47,7 +47,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.71 2020/01/18 21:08:42 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.72 2021/04/24 23:36:59 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1083,7 +1083,7 @@ kbd_enable(device_t dev)
k->k_wsenabled = 0;
/* Attach the wskbd */
- k->k_wskbd = config_found(k->k_dev, &a, wskbddevprint);
+ k->k_wskbd = config_found(k->k_dev, &a, wskbddevprint, CFARG_EOL);
callout_init(&k->k_wsbell, 0);
diff --git a/sys/dev/sun/sunms.c b/sys/dev/sun/sunms.c
index dd05ca02a69..eee08085ab2 100644
--- a/sys/dev/sun/sunms.c
+++ b/sys/dev/sun/sunms.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sunms.c,v 1.33 2017/10/31 10:46:47 martin Exp $ */
+/* $NetBSD: sunms.c,v 1.34 2021/04/24 23:36:59 thorpej Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -52,7 +52,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunms.c,v 1.33 2017/10/31 10:46:47 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunms.c,v 1.34 2021/04/24 23:36:59 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -174,7 +174,7 @@ sunms_attach(device_t parent, device_t self, void *aux)
a.accessops = &sunms_accessops;
a.accesscookie = ms;
- ms->ms_wsmousedev = config_found(self, &a, wsmousedevprint);
+ ms->ms_wsmousedev = config_found(self, &a, wsmousedevprint, CFARG_EOL);
#endif
}