driver core: fw_devlink: Avoid spurious error message
PATCH 1/1 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 3fb16866b51d ("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]>
--- drivers/base/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/base/core.c +3 -3
@@ -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 ; }
Signature · 1 line
2.39.2.637.g21b0678d19-goog
Quoted 10 lines · Saravana Kannan
fw_devlinkcan 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 <[email protected]>Reported-by Dmitry Baryshkov <[email protected]>Signed-off-by Saravana Kannan <[email protected]>
Quoted 24 lines
--- drivers/base/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/base/core.c +3
-4@@ -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