[PATCH] spi: microchip-core: Fix an error handling path in mchp_corespi_probe()

Christophe JAILLET posted 1 patch 1 week, 3 days ago
drivers/spi/spi-microchip-core-spi.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] spi: microchip-core: Fix an error handling path in mchp_corespi_probe()
Posted by Christophe JAILLET 1 week, 3 days ago
mchp_corespi_init() calls mchp_corespi_enable_ints(), so
mchp_corespi_disable_ints() should be called if an error occurs after
calling mchp_corespi_init(), as already done in the remove function.

Fixes: 059f545832be ("spi: add support for microchip "soft" spi controller")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
This patch is compile tested only.
---
 drivers/spi/spi-microchip-core-spi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-microchip-core-spi.c b/drivers/spi/spi-microchip-core-spi.c
index 98bf0e6cd00e..89e40fc45d73 100644
--- a/drivers/spi/spi-microchip-core-spi.c
+++ b/drivers/spi/spi-microchip-core-spi.c
@@ -387,6 +387,7 @@ static int mchp_corespi_probe(struct platform_device *pdev)
 
 	ret = devm_spi_register_controller(dev, host);
 	if (ret) {
+		mchp_corespi_disable_ints(spi);
 		mchp_corespi_disable(spi);
 		return dev_err_probe(dev, ret, "unable to register host for CoreSPI controller\n");
 	}
-- 
2.52.0
Re: [PATCH] spi: microchip-core: Fix an error handling path in mchp_corespi_probe()
Posted by Mark Brown 6 days, 12 hours ago
On Fri, 05 Dec 2025 22:14:10 +0100, Christophe JAILLET wrote:
> mchp_corespi_init() calls mchp_corespi_enable_ints(), so
> mchp_corespi_disable_ints() should be called if an error occurs after
> calling mchp_corespi_init(), as already done in the remove function.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: microchip-core: Fix an error handling path in mchp_corespi_probe()
      commit: 8cef9b451dc6fdf86b92c7a35d55a47465d500db

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
Re: [PATCH] spi: microchip-core: Fix an error handling path in mchp_corespi_probe()
Posted by Conor Dooley 1 week ago
On Fri, Dec 05, 2025 at 10:14:10PM +0100, Christophe JAILLET wrote:
> mchp_corespi_init() calls mchp_corespi_enable_ints(), so
> mchp_corespi_disable_ints() should be called if an error occurs after
> calling mchp_corespi_init(), as already done in the remove function.
> 
> Fixes: 059f545832be ("spi: add support for microchip "soft" spi controller")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Acked-by: Conor Dooley <conor.dooley@microchip.com>