mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
FROMGIT: 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: Saravana Kannan <[email protected]> Reviewed-by: Rob Herring <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry-pick from commit ba861f8e07bf38c457b98e1abf6ecd9fd8c4ee92 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git driver-core-next) Change-Id: Ie120fde8733b27976951142ef973b01f450bc8a0
This commit is contained in:
parent
ec120ba36d
commit
244b546612
1 changed files with 8 additions and 2 deletions
|
|
@ -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);
|
||||
is_populated = of_node_check_flag(sup_np, OF_POPULATED);
|
||||
of_node_put(sup_np);
|
||||
if (!sup_dev)
|
||||
return is_populated ? 0 : -EAGAIN;
|
||||
if (!sup_dev && is_populated) {
|
||||
/* 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))
|
||||
ret = -EAGAIN;
|
||||
put_device(sup_dev);
|
||||
|
|
|
|||
Loading…
Reference in a new issue