diff options
author | Jonas Jelonek <jelonek.jonas@gmail.com> | 2025-09-27 10:19:29 +0000 |
---|---|---|
committer | Andi Shyti <andi.shyti@kernel.org> | 2025-10-04 11:43:40 +0200 |
commit | 46fe8265685cb6003a0989b53e11e8afa4826572 (patch) | |
tree | 6e04b4d300ff55b8959a1ce3cb7533c44587f149 /rust/helpers/pci.c | |
parent | 059374aa0ab11a758a9e2219e90361911397b03d (diff) |
i2c: rtl9300: use scoped guard instead of explicit lock/unlock
Use the scoped guard infrastructure which unlocks a mutex automatically
when the guard goes out of scope, instead of explicit lock and unlock.
This simplifies the code and control flow in rtl9300_i2c_smbus_xfer and
removes the need of using goto in error cases to unlock before
returning.
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> # On RTL9302C based board
Tested-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20250927101931.71575-8-jelonek.jonas@gmail.com
Diffstat (limited to 'rust/helpers/pci.c')
0 files changed, 0 insertions, 0 deletions