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

Commit f6d207a3 authored by David Collins's avatar David Collins
Browse files

regulator: core: allow long device tree supply regulator property names



The length 32 buffer in of_get_regulator() limits the maximum
possible supply name to 24 characters (32 - 1 [null terminator]
- 7 [strlen("-supply")]).  This causes problems for device
nodes with longer supply property names.

Increase the size of the buffer to remove this artificial
restriction.

Change-Id: Ic28ee290dcd7411ba8325a2b42c12173958a11d8
Signed-off-by: default avatarDavid Collins <collinsd@codeaurora.org>
parent 7a88f5ef
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -241,11 +241,11 @@ static void regulator_unlock_supply(struct regulator_dev *rdev)
static struct device_node *of_get_regulator(struct device *dev, const char *supply)
static struct device_node *of_get_regulator(struct device *dev, const char *supply)
{
{
	struct device_node *regnode = NULL;
	struct device_node *regnode = NULL;
	char prop_name[32]; /* 32 is max size of property name */
	char prop_name[256];


	dev_dbg(dev, "Looking up %s-supply from device tree\n", supply);
	dev_dbg(dev, "Looking up %s-supply from device tree\n", supply);


	snprintf(prop_name, 32, "%s-supply", supply);
	snprintf(prop_name, sizeof(prop_name), "%s-supply", supply);
	regnode = of_parse_phandle(dev->of_node, prop_name, 0);
	regnode = of_parse_phandle(dev->of_node, prop_name, 0);


	if (!regnode) {
	if (!regnode) {