summaryrefslogtreecommitdiffstats
path: root/drivers/of/property.c
diff options
context:
space:
mode:
authorSaravana Kannan <saravanak@google.com>2020-04-16 22:58:38 +0200
committerRob Herring <robh@kernel.org>2020-04-28 19:47:47 +0200
commit8f88fad370bb0884f7f7217dea254b202df44716 (patch)
tree0009ffe5782b6d83a73122717fe1a973d7a8907f /drivers/of/property.c
parentdt-bindings: iio: adi,ltc2983: Add missing quotes on dependencies (diff)
downloadlinux-8f88fad370bb0884f7f7217dea254b202df44716.tar.xz
linux-8f88fad370bb0884f7f7217dea254b202df44716.zip
of: property: Don't retry device_link_add() upon failure
When of_link_to_phandle() was implemented initially, there was no way to tell if device_link_add() was failing because the supplier device hasn't been parsed yet, hasn't been added yet, the links were creating a cycle, etc. Some of these were transient errors that'd go away at a later point. However, with the current set of improved checks, if device_link_add() fails, it'll only be for permanent errors like cycles or out-of-memory errors. Also, with the addition of DL_FLAG_SYNC_STATE_ONLY flag [1] to device links, all the valid dependency cycles due to "proxy" device links (needed for correctness of sync_state() device callback) will never fail device_link_add() due to cycles. So, continuing to retry failing device links (by returning -EAGAIN) is no longer useful. At worst, it prevents platforms from setting fw_devlink=on (or better) because it prevents proper boot up. So, let's not do that anymore. [1] - https://lore.kernel.org/lkml/20191028220027.251605-1-saravanak@google.com/ Cc: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Saravana Kannan <saravanak@google.com> Tested-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'drivers/of/property.c')
-rw-r--r--drivers/of/property.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/of/property.c b/drivers/of/property.c
index 252e4f600155..ee1bc267f975 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -1074,7 +1074,7 @@ static int of_link_to_phandle(struct device *dev, struct device_node *sup_np,
return -EAGAIN;
}
if (!device_link_add(dev, sup_dev, dl_flags))
- ret = -EAGAIN;
+ ret = -EINVAL;
put_device(sup_dev);
return ret;
}