cpufreq: qcom-hw: Fix reading "reg" with address/size-cells != 2
authorKonrad Dybcio <konrad.dybcio@linaro.org>
Tue, 20 Dec 2022 13:39:10 +0000 (14:39 +0100)
committerViresh Kumar <viresh.kumar@linaro.org>
Tue, 27 Dec 2022 02:57:14 +0000 (08:27 +0530)
commit1a6a8b0080b09bf14a7d45abfe8020bd63306c17
tree0053b448c17733ec43e534ffb900153d484c4b86
parentf5f94b9c8b805d87ff185caf9779c3a4d07819e3
cpufreq: qcom-hw: Fix reading "reg" with address/size-cells != 2

Commit 054a3ef683a1 ("cpufreq: qcom-hw: Allocate qcom_cpufreq_data during
probe") assumed that every reg variable is 4*u32 wide (as most new qcom
SoCs set #address- and #size-cells to <2>. That is not the case for all of
them though. Check the cells values dynamically to ensure the proper
region of the DTB is being read.

Fixes: 054a3ef683a1 ("cpufreq: qcom-hw: Allocate qcom_cpufreq_data during probe")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/qcom-cpufreq-hw.c