Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

thermal: qcom-spmi: Treat reg property as a single cell

We only read the first element of the reg property to figure out
the offset of the temperature sensor inside the PMIC.
Furthermore, we want to remove the second element in DT, so just
don't read the second element so that probe keeps working if we
change the DT in the future.

Cc: Ivan T. Ivanov <iivanov.xz@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>

authored by

Stephen Boyd and committed by
Zhang Rui
cd323b2b f05f4821

+3 -3
+3 -3
drivers/thermal/qcom-spmi-temp-alarm.c
··· 200 200 struct qpnp_tm_chip *chip; 201 201 struct device_node *node; 202 202 u8 type, subtype; 203 - u32 res[2]; 203 + u32 res; 204 204 int ret, irq; 205 205 206 206 node = pdev->dev.of_node; ··· 215 215 if (!chip->map) 216 216 return -ENXIO; 217 217 218 - ret = of_property_read_u32_array(node, "reg", res, 2); 218 + ret = of_property_read_u32(node, "reg", &res); 219 219 if (ret < 0) 220 220 return ret; 221 221 ··· 228 228 if (PTR_ERR(chip->adc) == -EPROBE_DEFER) 229 229 return PTR_ERR(chip->adc); 230 230 231 - chip->base = res[0]; 231 + chip->base = res; 232 232 233 233 ret = qpnp_tm_read(chip, QPNP_TM_REG_TYPE, &type); 234 234 if (ret < 0) {