svn commit: r355361 - head/sys/dev/cpufreq

Emmanuel Vadot manu at FreeBSD.org
Tue Dec 3 22:26:56 UTC 2019


Author: manu
Date: Tue Dec  3 22:26:55 2019
New Revision: 355361
URL: https://svnweb.freebsd.org/changeset/base/355361

Log:
  cpufreq_dt: Do not fetch again hw.ncpu
  
  MD code already set the global variable mp_ncpus according to
  the tunable hw.ncpu so use the global variable directly.
  
  Reported by:	ian

Modified:
  head/sys/dev/cpufreq/cpufreq_dt.c

Modified: head/sys/dev/cpufreq/cpufreq_dt.c
==============================================================================
--- head/sys/dev/cpufreq/cpufreq_dt.c	Tue Dec  3 22:08:54 2019	(r355360)
+++ head/sys/dev/cpufreq/cpufreq_dt.c	Tue Dec  3 22:26:55 2019	(r355361)
@@ -446,7 +446,7 @@ cpufreq_dt_attach(device_t dev)
 	struct cpufreq_dt_softc *sc;
 	phandle_t node;
 	phandle_t cnode, opp, copp;
-	int cpu, ncpu;
+	int cpu;
 	uint64_t freq;
 	int rv = 0;
 	enum opp_version version;
@@ -456,11 +456,9 @@ cpufreq_dt_attach(device_t dev)
 	node = ofw_bus_get_node(device_get_parent(dev));
 	cpu = device_get_unit(device_get_parent(dev));
 
-	if (TUNABLE_INT_FETCH("hw.ncpu", &ncpu)) {
-		if (cpu >= ncpu) {
-			device_printf(dev, "Not attaching as cpu is not present\n");
-			return (ENXIO);
-		}
+	if (cpu >= mp_ncpus) {
+		device_printf(dev, "Not attaching as cpu is not present\n");
+		return (ENXIO);
 	}
 
 	if (regulator_get_by_ofw_property(dev, node,


More information about the svn-src-all mailing list