Commit bf3fba7
leds: rgb: mt6370: Switch to device_for_each_child_node_scoped()
Switch to device_for_each_child_node_scoped() to simplify the code by
removing the need for calls to fwnode_handle_put() in the error paths.
This also prevents possible memory leaks if new error paths are added
without the required call to fwnode_handle_put().
After switching to the scoped variant, there is no longer need for a
jump to 'fwnode_release', as an immediate return is possible. Given that
the loop is called in the probe function, and it already uses
dev_err_probe(), the common "dev_err() + return" has been updated as
well.
Signed-off-by: Javier Carrasco <[email protected]>
Link: https://lore.kernel.org/r/20240927-leds_device_for_each_child_node_scoped-v1-18-95c0614b38c8@gmail.com
Signed-off-by: Lee Jones <[email protected]>1 parent 4825963 commit bf3fba7
1 file changed
+11
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
905 | 905 | | |
906 | 906 | | |
907 | 907 | | |
908 | | - | |
909 | 908 | | |
910 | 909 | | |
911 | 910 | | |
| |||
936 | 935 | | |
937 | 936 | | |
938 | 937 | | |
939 | | - | |
| 938 | + | |
940 | 939 | | |
941 | 940 | | |
942 | 941 | | |
943 | 942 | | |
944 | 943 | | |
945 | | - | |
946 | | - | |
947 | | - | |
948 | | - | |
| 944 | + | |
| 945 | + | |
949 | 946 | | |
950 | | - | |
951 | | - | |
952 | | - | |
953 | | - | |
954 | | - | |
| 947 | + | |
| 948 | + | |
955 | 949 | | |
956 | 950 | | |
957 | | - | |
958 | | - | |
959 | | - | |
960 | | - | |
| 951 | + | |
| 952 | + | |
961 | 953 | | |
962 | 954 | | |
963 | 955 | | |
964 | 956 | | |
965 | | - | |
966 | | - | |
967 | | - | |
968 | | - | |
969 | | - | |
| 957 | + | |
| 958 | + | |
970 | 959 | | |
971 | 960 | | |
972 | 961 | | |
| |||
975 | 964 | | |
976 | 965 | | |
977 | 966 | | |
978 | | - | |
| 967 | + | |
979 | 968 | | |
980 | 969 | | |
981 | 970 | | |
982 | | - | |
| 971 | + | |
983 | 972 | | |
984 | 973 | | |
985 | 974 | | |
986 | | - | |
987 | | - | |
988 | | - | |
989 | | - | |
990 | 975 | | |
991 | 976 | | |
992 | 977 | | |
| |||
0 commit comments