All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] driver core: simply go out if the same device_link is added again
@ 2020-11-19 11:00 Dong Aisheng
  2020-11-19 11:00 ` [PATCH 2/3] of: property: add debug info for supplier devices still unavailable Dong Aisheng
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Dong Aisheng @ 2020-11-19 11:00 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-imx, dongas86, Dong Aisheng, Greg Kroah-Hartman,
	Rafael J. Wysocki, Saravana Kannan

It's possible that the same device link may be added by parsing the
function dependecy in DT. e.g. clock/gpio/regulators.
Simply go out for this case.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Saravana Kannan <saravanak@google.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
 drivers/base/core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index 4c03bdd3a268..7d91d4074136 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -567,6 +567,9 @@ struct device_link *device_link_add(struct device *consumer,
 		if (link->consumer != consumer)
 			continue;
 
+		if (flags == link->flags)
+			goto out;
+
 		if (flags & DL_FLAG_PM_RUNTIME) {
 			if (!(link->flags & DL_FLAG_PM_RUNTIME)) {
 				pm_runtime_new_link(consumer);
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-11-19 17:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-19 11:00 [PATCH 1/3] driver core: simply go out if the same device_link is added again Dong Aisheng
2020-11-19 11:00 ` [PATCH 2/3] of: property: add debug info for supplier devices still unavailable Dong Aisheng
2020-11-19 17:48   ` Saravana Kannan
2020-11-19 11:00 ` [PATCH 3/3] of: property: fix document of of_get_next_parent_dev Dong Aisheng
2020-11-19 17:49   ` Saravana Kannan
2020-11-19 12:11 ` [PATCH 1/3] driver core: simply go out if the same device_link is added again Rafael J. Wysocki
2020-11-19 15:44   ` Aisheng Dong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.