drivers/spi/spi-nxp-fspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
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>
---
Changes in v2:
* Split the patch to one seperate patch for each sub-system.
Link to v1: https://lore.kernel.org/all/pnd7c0s6ji2.fsf@axis.com/
drivers/spi/spi-nxp-fspi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c
index b92bfef47371..848fa9319e36 100644
--- a/drivers/spi/spi-nxp-fspi.c
+++ b/drivers/spi/spi-nxp-fspi.c
@@ -1284,7 +1284,7 @@ static int nxp_fspi_probe(struct platform_device *pdev)
ret = devm_add_action_or_reset(dev, nxp_fspi_cleanup, f);
if (ret)
- return dev_err_probe(dev, ret, "Failed to register nxp_fspi_cleanup\n");
+ return ret;
return devm_spi_register_controller(&pdev->dev, ctlr);
}
base-commit: 260f6f4fda93c8485c8037865c941b42b9cba5d2
--
2.39.5
On Tue, 05 Aug 2025 11:33:37 +0200, Waqar Hameed wrote: > 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. > > > [...] Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next Thanks! [1/1] spi: nxp-fspi: Remove error print for devm_add_action_or_reset() commit: 692abf80ce8443a4ded8cade25a1acf772436293 All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark
© 2016 - 2025 Red Hat, Inc.