Commit ba861f8e authored by Saravana Kannan's avatar Saravana Kannan Committed by Greg Kroah-Hartman

of: property: Minor style clean up of of_link_to_phandle()

Adding a debug log instead of silently ignoring a phandle for an early
device. Also, return the right error code instead of 0 even though the
actual execution flow won't change.
Signed-off-by: default avatarSaravana Kannan <saravanak@google.com>
Reviewed-by: default avatarRob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20191105065000.50407-2-saravanak@google.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cc4c8318
...@@ -1051,8 +1051,14 @@ static int of_link_to_phandle(struct device *dev, struct device_node *sup_np, ...@@ -1051,8 +1051,14 @@ static int of_link_to_phandle(struct device *dev, struct device_node *sup_np,
sup_dev = get_dev_from_fwnode(&sup_np->fwnode); sup_dev = get_dev_from_fwnode(&sup_np->fwnode);
is_populated = of_node_check_flag(sup_np, OF_POPULATED); is_populated = of_node_check_flag(sup_np, OF_POPULATED);
of_node_put(sup_np); of_node_put(sup_np);
if (!sup_dev) if (!sup_dev && is_populated) {
return is_populated ? 0 : -EAGAIN; /* Early device without struct device. */
dev_dbg(dev, "Not linking to %pOFP - No struct device\n",
sup_np);
return -ENODEV;
} else if (!sup_dev) {
return -EAGAIN;
}
if (!device_link_add(dev, sup_dev, dl_flags)) if (!device_link_add(dev, sup_dev, dl_flags))
ret = -EAGAIN; ret = -EAGAIN;
put_device(sup_dev); put_device(sup_dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment