From 725b72d5e045dd57f89968032dd62b56197093ea Mon Sep 17 00:00:00 2001 From: Andrew Turner Date: Fri, 28 Aug 2015 10:34:37 +0000 Subject: [PATCH] Only check for the bus frequency if it has not already been set, for example through a driver running as a subclass of this. Sponsored by: ABT Systems Ltd --- sys/dev/mmc/host/dwmmc.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/dev/mmc/host/dwmmc.c b/sys/dev/mmc/host/dwmmc.c index bf28e47ce76..6e29fb9d10a 100644 --- a/sys/dev/mmc/host/dwmmc.c +++ b/sys/dev/mmc/host/dwmmc.c @@ -481,10 +481,12 @@ parse_fdt(struct dwmmc_softc *sc) * what the clock is supplied for our device. * For now rely on the value specified in FDT. */ - if ((len = OF_getproplen(node, "bus-frequency")) <= 0) - return (ENXIO); - OF_getencprop(node, "bus-frequency", dts_value, len); - sc->bus_hz = dts_value[0]; + if (sc->bus_hz == 0) { + if ((len = OF_getproplen(node, "bus-frequency")) <= 0) + return (ENXIO); + OF_getencprop(node, "bus-frequency", dts_value, len); + sc->bus_hz = dts_value[0]; + } /* * Platform-specific stuff