]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
usb: misc: eud: Remove error print for devm_add_action_or_reset()
authorWaqar Hameed <waqar.hameed@axis.com>
Tue, 5 Aug 2025 09:33:37 +0000 (11:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Aug 2025 14:55:36 +0000 (16:55 +0200)
When `devm_add_action_or_reset()` fails, it is due to a failed memory
allocation and will thus return `-ENOMEM`. `dev_err_probe()` doesn't do
anything when error is `-ENOMEM`. Therefore, remove the useless call to
`dev_err_probe()` when `devm_add_action_or_reset()` fails, and just
return the value instead.

Signed-off-by: Waqar Hameed <waqar.hameed@axis.com>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/pndo6sukt8u.a.out@axis.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/misc/qcom_eud.c

index 83079c414b4f281b2136d0d1eb39418c7f94ff8c..67832790acad28183a23b137c3929ec7b06bc0c4 100644 (file)
@@ -193,8 +193,7 @@ static int eud_probe(struct platform_device *pdev)
 
        ret = devm_add_action_or_reset(chip->dev, eud_role_switch_release, chip);
        if (ret)
-               return dev_err_probe(chip->dev, ret,
-                               "failed to add role switch release action\n");
+               return ret;
 
        chip->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(chip->base))