]> www.infradead.org Git - users/jedix/linux-maple.git/commit
spi: fsl-qspi: Simplify probe error handling using managed API
authorKevin Hao <haokexin@gmail.com>
Thu, 10 Apr 2025 06:56:11 +0000 (14:56 +0800)
committerMark Brown <broonie@kernel.org>
Thu, 10 Apr 2025 11:25:22 +0000 (12:25 +0100)
commit3f7b48efb79d91883d98dd7e33dc2a0abfa9f923
tree3a9fe95a438c1688bbc9914ea8835208bf826f90
parent82bedbfedd2fc7cd1287732879e515ceb94f8963
spi: fsl-qspi: Simplify probe error handling using managed API

- Switch to devm_spi_alloc_host() to avoid manual spi_controller_put()
  calls in error paths.

- Factor out the hardware disable logic into a dedicated
  fsl_qspi_disable() helper and register it as a managed cleanup action,
  removing the need to explicitly disable hardware after
  fsl_qspi_default_setup() failures.

- Move fsl_qspi_cleanup() earlier in the probe sequence to eliminate
  the need for manual cleanup in the irq failure path.

With these changes we can completely eliminate the messy goto labels
in probe function.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
Link: https://patch.msgid.link/20250410-spi-v1-3-56e867cc19cf@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-fsl-qspi.c