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;
|
struct cpufreq_dt_softc *sc;
|
||||||
phandle_t node;
|
phandle_t node;
|
||||||
phandle_t cnode, opp, copp;
|
phandle_t cnode, opp, copp;
|
||||||
int cpu, ncpu;
|
int cpu;
|
||||||
uint64_t freq;
|
uint64_t freq;
|
||||||
int rv = 0;
|
int rv = 0;
|
||||||
enum opp_version version;
|
enum opp_version version;
|
||||||
@ -456,11 +456,9 @@ cpufreq_dt_attach(device_t dev)
|
|||||||
node = ofw_bus_get_node(device_get_parent(dev));
|
node = ofw_bus_get_node(device_get_parent(dev));
|
||||||
cpu = device_get_unit(device_get_parent(dev));
|
cpu = device_get_unit(device_get_parent(dev));
|
||||||
|
|
||||||
if (TUNABLE_INT_FETCH("hw.ncpu", &ncpu)) {
|
if (cpu >= mp_ncpus) {
|
||||||
if (cpu >= ncpu) {
|
device_printf(dev, "Not attaching as cpu is not present\n");
|
||||||
device_printf(dev, "Not attaching as cpu is not present\n");
|
return (ENXIO);
|
||||||
return (ENXIO);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (regulator_get_by_ofw_property(dev, node,
|
if (regulator_get_by_ofw_property(dev, node,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user