[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201119110036.19959-1-aisheng.dong@nxp.com>
Date: Thu, 19 Nov 2020 19:00:34 +0800
From: Dong Aisheng <aisheng.dong@....com>
To: linux-kernel@...r.kernel.org
Cc: linux-imx@....com, dongas86@...il.com,
Dong Aisheng <aisheng.dong@....com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Saravana Kannan <saravanak@...gle.com>
Subject: [PATCH 1/3] driver core: simply go out if the same device_link is added again
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@...uxfoundation.org>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>
Cc: Saravana Kannan <saravanak@...gle.com>
Signed-off-by: Dong Aisheng <aisheng.dong@....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
Powered by blists - more mailing lists