summaryrefslogtreecommitdiff
path: root/sys/dev/sdmmc
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/sdmmc
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/sdmmc')
-rw-r--r--sys/dev/sdmmc/sdhc.c6
-rw-r--r--sys/dev/sdmmc/sdmmc.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/sdmmc/sdhc.c b/sys/dev/sdmmc/sdhc.c
index 4688cf9283e..6c80af99f08 100644
--- a/sys/dev/sdmmc/sdhc.c
+++ b/sys/dev/sdmmc/sdhc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sdhc.c,v 1.108 2021/03/13 23:26:47 mlelstv Exp $ */
+/* $NetBSD: sdhc.c,v 1.109 2021/04/24 23:36:59 thorpej Exp $ */
/* $OpenBSD: sdhc.c,v 1.25 2009/01/13 19:44:20 grange Exp $ */
/*
@@ -23,7 +23,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.108 2021/03/13 23:26:47 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.109 2021/04/24 23:36:59 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_sdmmc.h"
@@ -642,7 +642,7 @@ adma_done:
if (ISSET(sc->sc_flags, SDHC_FLAG_BROKEN_ADMA2_ZEROLEN))
saa.saa_max_seg = 65535;
- hp->sdmmc = config_found(sc->sc_dev, &saa, sdhc_cfprint);
+ hp->sdmmc = config_found(sc->sc_dev, &saa, sdhc_cfprint, CFARG_EOL);
return 0;
diff --git a/sys/dev/sdmmc/sdmmc.c b/sys/dev/sdmmc/sdmmc.c
index cbd7a2dece4..9c75bc699be 100644
--- a/sys/dev/sdmmc/sdmmc.c
+++ b/sys/dev/sdmmc/sdmmc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sdmmc.c,v 1.40 2020/05/24 17:26:18 riastradh Exp $ */
+/* $NetBSD: sdmmc.c,v 1.41 2021/04/24 23:36:59 thorpej Exp $ */
/* $OpenBSD: sdmmc.c,v 1.18 2009/01/09 10:58:38 jsg Exp $ */
/*
@@ -49,7 +49,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sdmmc.c,v 1.40 2020/05/24 17:26:18 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdmmc.c,v 1.41 2021/04/24 23:36:59 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_sdmmc.h"
@@ -477,7 +477,7 @@ sdmmc_card_attach(struct sdmmc_softc *sc)
saa.sf = sf;
sf->child =
- config_found_ia(sc->sc_dev, "sdmmc", &saa, sdmmc_print);
+ config_found(sc->sc_dev, &saa, sdmmc_print, CFARG_EOL);
}
SET(sc->sc_flags, SMF_CARD_ATTACHED);