summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2023-07-01 08:27:27 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2023-07-01 08:27:27 +0000
commitdd4268c278d2e5c105d2c60d4f160c3cc8d7fa16 (patch)
tree4fb5fd8bbb0b5ea3961bc166153862107798772e /sys
parent43dd1e52cf75e02d8a8bd2777cf51337d466652c (diff)
Warn and fail to attach dwmmc(4) if no clock base is found.
This makes it easier to track down clock related issues. ok kettenis@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/fdt/dwmmc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/fdt/dwmmc.c b/sys/dev/fdt/dwmmc.c
index cf33a5df22d..a66318fb792 100644
--- a/sys/dev/fdt/dwmmc.c
+++ b/sys/dev/fdt/dwmmc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dwmmc.c,v 1.28 2023/07/01 08:22:41 jsing Exp $ */
+/* $OpenBSD: dwmmc.c,v 1.29 2023/07/01 08:27:26 jsing Exp $ */
/*
* Copyright (c) 2017 Mark Kettenis
*
@@ -359,6 +359,10 @@ dwmmc_attach(struct device *parent, struct device *self, void *aux)
/* if ciu clock is missing the rate is clock-frequency */
if (sc->sc_clkbase == 0)
sc->sc_clkbase = freq;
+ if (sc->sc_clkbase == 0) {
+ printf(": no clock base\n");
+ return;
+ }
div = OF_getpropint(faa->fa_node, "samsung,dw-mshc-ciu-div", div);
sc->sc_clkbase /= (div + 1);