Skip to content

Commit 6309872

Browse files
Saravana Kannangregkh
authored andcommitted
driver core: fw_devlink: Avoid spurious error message
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: 3fb1686 ("driver core: fw_devlink: Make cycle detection more robust") Reported-by: Vladimir Oltean <[email protected]> Reported-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Saravana Kannan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent e8b812b commit 6309872

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/base/core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2046,9 +2046,9 @@ static int fw_devlink_create_devlink(struct device *con,
20462046
goto out;
20472047
}
20482048

2049-
if (!device_link_add(con, sup_dev, flags)) {
2050-
dev_err(con, "Failed to create device link with %s\n",
2051-
dev_name(sup_dev));
2049+
if (con != sup_dev && !device_link_add(con, sup_dev, flags)) {
2050+
dev_err(con, "Failed to create device link (0x%x) with %s\n",
2051+
flags, dev_name(sup_dev));
20522052
ret = -EINVAL;
20532053
}
20542054

0 commit comments

Comments
 (0)