]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
scsi: ufs: core: Remove error print for devm_add_action_or_reset()
authorWaqar Hameed <waqar.hameed@axis.com>
Tue, 5 Aug 2025 09:33:36 +0000 (11:33 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 6 Aug 2025 02:34:00 +0000 (22:34 -0400)
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>
Link: https://lore.kernel.org/r/pndtt2mkt8v.a.out@axis.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/ufs/core/ufshcd.c

index baf28bd748ccf0af8f453f43fd42b57d4e3068d4..2e1fa8cf83f56e1e7b57c2f8c54f3762b2ced252 100644 (file)
@@ -10515,8 +10515,7 @@ int ufshcd_alloc_host(struct device *dev, struct ufs_hba **hba_handle)
        err = devm_add_action_or_reset(dev, ufshcd_devres_release,
                                       host);
        if (err)
-               return dev_err_probe(dev, err,
-                                    "failed to add ufshcd dealloc action\n");
+               return err;
 
        host->nr_maps = HCTX_TYPE_POLL + 1;
        hba = shost_priv(host);