From: Saravana Kannan <saravanak@google.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Saravana Kannan <saravanak@google.com>
Cc: Vladimir Oltean <vladimir.oltean@nxp.com>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
kernel-team@android.com, linux-kernel@vger.kernel.org
Subject: [PATCH v1] driver core: fw_devlink: Avoid spurious error message
Date: Fri, 24 Feb 2023 22:41:47 -0800 [thread overview]
Message-ID: <20230225064148.274376-1-saravanak@google.com> (raw)
fw_devlink can sometimes try to create a device link with the consumer
and supplier as the same device. These attempts will fail (correctly),
but are harmless. So, avoid printing an error for these cases. Also, add
more detail to the error message.
Fixes: 3fb16866b51d ("driver core: fw_devlink: Make cycle detection more robust")
Reported-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reported-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Saravana Kannan <saravanak@google.com>
---
drivers/base/core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index f9297c68214a..4f02a10f802f 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -2088,9 +2088,9 @@ static int fw_devlink_create_devlink(struct device *con,
goto out;
}
- if (!device_link_add(con, sup_dev, flags)) {
- dev_err(con, "Failed to create device link with %s\n",
- dev_name(sup_dev));
+ if (con != sup_dev && !device_link_add(con, sup_dev, flags)) {
+ dev_err(con, "Failed to create device link (0x%x) with %s\n",
+ flags, dev_name(sup_dev));
ret = -EINVAL;
}
--
2.39.2.637.g21b0678d19-goog
next reply other threads:[~2023-02-25 6:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-25 6:41 Saravana Kannan [this message]
2023-02-27 13:03 ` [PATCH v1] driver core: fw_devlink: Avoid spurious error message Rafael J. Wysocki
-- strict thread matches above, loose matches on Subject: below --
2023-10-02 14:18 Root Mailer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230225064148.274376-1-saravanak@google.com \
--to=saravanak@google.com \
--cc=dmitry.baryshkov@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=vladimir.oltean@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox