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
This commit is contained in:
Andrew Turner 2015-08-28 10:34:37 +00:00
parent 196074f3b2
commit 725b72d5e0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=287250

View File

@ -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