From: Benjamin Gaignard benjamin.gaignard@linaro.org
commit e16f4f3e0b7daecd48d4f944ab4147c1a6cb16a8 upstream
In some cases the link between between customer and supplier already exist, for example when a device use its parent as a supplier. Do not warn about already existing dependencies because device_link_add() takes care of this case.
Link: http://lkml.kernel.org/r/20180709111753eucas1p1f32e66fb2f7ea3216097cd72a1323...
Reported-by: Marek Szyprowski m.szyprowski@samsung.com Reviewed-by: Mark Brown broonie@kernel.org Signed-off-by: Benjamin Gaignard benjamin.gaignard@st.com Reviewed-by: Rafael J. Wysocki rafael@kernel.org Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org Signed-off-by: Sudip Mukherjee sudipm.mukherjee@gmail.com Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org --- drivers/base/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -109,7 +109,7 @@ static int device_is_dependent(struct de struct device_link *link; int ret;
- if (WARN_ON(dev == target)) + if (dev == target) return 1;
ret = device_for_each_child(dev, target, device_is_dependent); @@ -117,7 +117,7 @@ static int device_is_dependent(struct de return ret;
list_for_each_entry(link, &dev->links.consumers, s_node) { - if (WARN_ON(link->consumer == target)) + if (link->consumer == target) return 1;
ret = device_is_dependent(link->consumer, target);