Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6198175c authored by David Collins's avatar David Collins Committed by Kiran Gunda
Browse files

regulator: qcom_pm8008: change reg property format from u16 to u32



Use of_property_read_u32() instead of of_property_read_u16() to
read the "reg" property of each PM8008 regulator device tree node.
This allows the "reg" property value to be specified in device
tree without the parameter "/bits/ 16".  This in turn avoids
device tree compilation warnings like this one:

arch/arm64/boot/dts/vendor/qcom/lahaina-pmic-overlay.dtsi:68.5-30:
Warning (reg_format):
  /soc/i2c@a94000/pm8008i@8/qcom,pm8008i-regulator/regulator@4000:reg:
  property has invalid length (2 bytes)
  (#address-cells == 1, #size-cells == 0)

Change-Id: I69d7af28339abf3b7ed1365ccfc9343958f944da
Signed-off-by: default avatarDavid Collins <collinsd@codeaurora.org>
parent 850aa1f1
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2019, The Linux Foundation. All rights reserved. */
/* Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. */

#define pr_fmt(fmt) "PM8008: %s: " fmt, __func__

@@ -506,6 +506,7 @@ static int pm8008_register_ldo(struct pm8008_regulator *pm8008_reg,
	struct device_node *reg_node = pm8008_reg->of_node;
	char buff[MAX_REG_NAME];
	int rc, i, init_voltage;
	u32 base = 0;
	u8 reg;

	/* get regulator data */
@@ -518,11 +519,12 @@ static int pm8008_register_ldo(struct pm8008_regulator *pm8008_reg,
		return -EINVAL;
	}

	rc = of_property_read_u16(reg_node, "reg", &pm8008_reg->base);
	rc = of_property_read_u32(reg_node, "reg", &base);
	if (rc < 0) {
		pr_err("%s: failed to get regulator base rc=%d\n", name, rc);
		return rc;
	}
	pm8008_reg->base = base;

	pm8008_reg->min_dropout_uv = reg_data[i].min_dropout_uv;
	of_property_read_u32(reg_node, "qcom,min-dropout-voltage",