[PATCH v7 5/7] PCI: brcmstb: Add control of subdevice voltage regulators

Mark Brown broonie at kernel.org
Wed Nov 3 12:45:35 PDT 2021


On Wed, Nov 03, 2021 at 02:49:35PM -0400, Jim Quinlan wrote:

> +	for_each_property_of_node(dn, pp) {
> +		for (i = 0; i < ns; i++) {
> +			char prop_name[64]; /* 64 is max size of property name */
> +
> +			snprintf(prop_name, 64, "%s-supply", supplies[i]);
> +			if (strcmp(prop_name, pp->name) == 0)
> +				break;
> +		}
> +		if (i >= ns || pcie->num_supplies >= ARRAY_SIZE(supplies))
> +			continue;
> +
> +		pcie->supplies[pcie->num_supplies++].supply = supplies[i];
> +	}

Why are we doing this?  If the DT omits the supplies the framework will
provide dummy supplies so there is no need to open code handling for
supplies not being present at all in client drivers.  Just
unconditionally ask for all the supplies.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20211103/9c6bee45/attachment.sig>


More information about the linux-arm-kernel mailing list