diff options
author | Saravana Kannan <saravanak@google.com> | 2023-02-25 09:41:47 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-10 11:34:01 +0300 |
commit | 11d93294b7c335de7cd696d92b40b6a3ec063966 (patch) | |
tree | 0f1156d9ddfed2c0489b95dfc71d77697fb280ce | |
parent | 29bc917b68a695c1c71ccf2f7e7c1ed11322f2c7 (diff) | |
download | linux-11d93294b7c335de7cd696d92b40b6a3ec063966.tar.xz |
driver core: fw_devlink: Avoid spurious error message
[ Upstream commit 6309872413f14f3d58c13ae4dc85b1a7004b4193 ]
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>
Link: https://lore.kernel.org/r/20230225064148.274376-1-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/base/core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c index ac08d475e282..e30223c2672f 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -2087,9 +2087,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; } |