spi: geni-qcom: Use devm functions to simplify code
Use devm_pm_runtime_enable(), devm_request_irq() and devm_spi_register_controller() to simplify code. And also register a callback spi_geni_release_dma_chan() with devm_add_action_or_reset(), to release dma channel in both error and device detach path, which can make sure the release sequence is consistent with the original one. 1. Unregister spi controller. 2. Free the IRQ. 3. Free DMA chans 4. Disable runtime PM. So the remove function can also be removed. Reviewed-by: Douglas Anderson <dianders@chromium.org> Suggested-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Link: https://patch.msgid.link/20240912091701.3720857-1-ruanjinjie@huawei.comSigned-off-by: Mark Brown <broonie@kernel.org>
Showing
Please register or sign in to comment