summaryrefslogtreecommitdiff
path: root/sys/dev/pci/pccbb.c
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/pci/pccbb.c
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/pci/pccbb.c')
-rw-r--r--sys/dev/pci/pccbb.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/pci/pccbb.c b/sys/dev/pci/pccbb.c
index e8b3733d414..aaccbe8a997 100644
--- a/sys/dev/pci/pccbb.c
+++ b/sys/dev/pci/pccbb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pccbb.c,v 1.215 2019/11/10 21:16:36 chs Exp $ */
+/* $NetBSD: pccbb.c,v 1.216 2021/04/24 23:36:57 thorpej Exp $ */
/*
* Copyright (c) 1998, 1999 and 2000
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pccbb.c,v 1.215 2019/11/10 21:16:36 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pccbb.c,v 1.216 2021/04/24 23:36:57 thorpej Exp $");
/*
#define CBB_DEBUG
@@ -680,8 +680,9 @@ pccbb_pci_callback(device_t self)
pccbb_intrinit(sc);
- if (NULL != (csc = config_found_ia(self, "pcmciaslot", &caa,
- cbbprint))) {
+ if (NULL != (csc = config_found(self, &caa, cbbprint,
+ CFARG_IATTR, "pcmciaslot",
+ CFARG_EOL))) {
DPRINTF(("%s: found cardslot\n", __func__));
sc->sc_csc = device_private(csc);
}