Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Aug 2015 10:34:38 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r287250 - head/sys/dev/mmc/host
Message-ID:  <201508281034.t7SAYcNG014196@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andrew
Date: Fri Aug 28 10:34:37 2015
New Revision: 287250
URL: https://svnweb.freebsd.org/changeset/base/287250

Log:
  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

Modified:
  head/sys/dev/mmc/host/dwmmc.c

Modified: head/sys/dev/mmc/host/dwmmc.c
==============================================================================
--- head/sys/dev/mmc/host/dwmmc.c	Fri Aug 28 09:38:18 2015	(r287249)
+++ head/sys/dev/mmc/host/dwmmc.c	Fri Aug 28 10:34:37 2015	(r287250)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201508281034.t7SAYcNG014196>