From: jsing Date: Sat, 1 Jul 2023 08:27:26 +0000 (+0000) Subject: Warn and fail to attach dwmmc(4) if no clock base is found. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2b571f7f12172748274c0659de75c80671d25f74;p=openbsd 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@ --- 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);