lkml.org 
[lkml]   [2020]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/3] driver core: simply go out if the same device_link is added again
Date
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
\
 
 \ /
  Last update: 2020-11-19 12:20    [W:0.076 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site