diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2022-08-27 14:42:19 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-08-29 19:51:37 +0300 |
commit | 3d6af96814d753f34cf897466e7ddf041d0cdf3b (patch) | |
tree | 01a4335b5b7e325043cc29fc82d26536a2d4a960 /tools/perf/scripts/python/export-to-sqlite.py | |
parent | 2b2bf6b7faa9010fae10dc7de76627a3fdb525b3 (diff) | |
download | linux-3d6af96814d753f34cf897466e7ddf041d0cdf3b.tar.xz |
spi: mt7621: Use the devm_clk_get_enabled() helper to simplify error handling
The devm_clk_get_enabled() helper:
- calls devm_clk_get()
- calls clk_prepare_enable() and registers what is needed in order to
call clk_disable_unprepare() when needed, as a managed resource.
This helper is well suited for cases where the clock would be kept
prepared or enabled for the whole lifetime of the driver.
This simplifies the error handling a lot.
The order between spi_unregister_controller() (in the remove function) and
the clk_disable_unprepare() (now handle by a managed resource) is kept
the same.
(see commit 46b5c4fb87ce ("spi: mt7621: Don't leak SPI master in probe
error path") to see why it matters)
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Link: https://lore.kernel.org/r/05a7fd22719008c8a905d6328aa9548ce40f2a7a.1661599671.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions