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
This commit is contained in:
parent
05d5e3b30d
commit
49cbef7749
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user