diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2023-07-01 08:27:27 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2023-07-01 08:27:27 +0000 |
commit | dd4268c278d2e5c105d2c60d4f160c3cc8d7fa16 (patch) | |
tree | 4fb5fd8bbb0b5ea3961bc166153862107798772e /sys | |
parent | 43dd1e52cf75e02d8a8bd2777cf51337d466652c (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.c | 6 |
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); |