Re: [PATCH RESEND 4.4.y-cip 08/15] PM / OPP: Parse 'opp-<prop>-<name>' bindings


Chen-Yu Tsai (Moxa) <wens@...>
 

On Thu, Jun 4, 2020 at 5:03 PM Pavel Machek <pavel@denx.de> wrote:

Hi!

/* TODO: Support multiple regulators */
-static int opp_parse_supplies(struct dev_pm_opp *opp, struct device *dev)
+static int opp_parse_supplies(struct dev_pm_opp *opp, struct device *dev,
+ struct device_opp *dev_opp)
{
u32 microvolt[3] = {0};
u32 val;
int count, ret;
+ struct property *prop = NULL;
+ char name[NAME_MAX];
+
+ /* Search for "opp-microvolt-<name>" */
+ if (dev_opp->prop_name) {
+ sprintf(name, "opp-microvolt-%s", dev_opp->prop_name);
+ prop = of_find_property(opp->np, name, NULL);
+ }
+
+ if (!prop) {
+ /* Search for "opp-microvolt" */
+ name[13] = '\0';
+ prop = of_find_property(opp->np, name, NULL);
If in !dev_opp->prop_name, it will pass uninitialized buffer to
of_find_property.
This is fixed in the next patch. But I wonder if we should merge them
into one for -cip... Unlike mainline, we already know about the
bug. No need to prepare trap for people doing bisect.
That is a good argument. I suppose we just need to make sure the end
result records both upstream commits, and that all of our automated
tools can handle that.

ChenYu

Join cip-dev@lists.cip-project.org to automatically receive all group messages.