Commit f3c1ef2
iio: adc: xilinx-ams: use guard(mutex) for automatic locking
Replace open-coded mutex_lock()/mutex_unlock() pairs with
guard(mutex) to simplify locking and ensure proper unlock on
all control flow paths.
This removes explicit unlock handling, reduces boilerplate,
and avoids potential mistakes in error paths while keeping
the behavior unchanged.
Signed-off-by: Guilherme Ivo Bozi <guilherme.bozi@usp.br>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: Salih Erim <salih.erim@amd.com>
Tested-by: Salih Erim <salih.erim@amd.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>1 parent 947eb6f commit f3c1ef2
1 file changed
Lines changed: 8 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
720 | 720 | | |
721 | 721 | | |
722 | 722 | | |
723 | | - | |
724 | | - | |
| 723 | + | |
| 724 | + | |
725 | 725 | | |
726 | 726 | | |
727 | 727 | | |
728 | | - | |
| 728 | + | |
729 | 729 | | |
730 | 730 | | |
731 | 731 | | |
732 | 732 | | |
733 | 733 | | |
734 | 734 | | |
735 | | - | |
736 | | - | |
737 | | - | |
738 | | - | |
| 735 | + | |
| 736 | + | |
739 | 737 | | |
740 | 738 | | |
741 | 739 | | |
| |||
939 | 937 | | |
940 | 938 | | |
941 | 939 | | |
942 | | - | |
| 940 | + | |
943 | 941 | | |
944 | 942 | | |
945 | 943 | | |
| |||
948 | 946 | | |
949 | 947 | | |
950 | 948 | | |
951 | | - | |
952 | | - | |
953 | 949 | | |
954 | 950 | | |
955 | 951 | | |
| |||
962 | 958 | | |
963 | 959 | | |
964 | 960 | | |
965 | | - | |
| 961 | + | |
966 | 962 | | |
967 | 963 | | |
968 | 964 | | |
969 | 965 | | |
970 | 966 | | |
971 | 967 | | |
972 | | - | |
973 | | - | |
974 | 968 | | |
975 | 969 | | |
976 | 970 | | |
| |||
983 | 977 | | |
984 | 978 | | |
985 | 979 | | |
986 | | - | |
| 980 | + | |
987 | 981 | | |
988 | 982 | | |
989 | 983 | | |
| |||
1005 | 999 | | |
1006 | 1000 | | |
1007 | 1001 | | |
1008 | | - | |
1009 | | - | |
1010 | 1002 | | |
1011 | 1003 | | |
1012 | 1004 | | |
| |||
0 commit comments