iio: adc: ad9081: use guard(mutex) to protect critical sections#2992
Merged
mhennerich merged 4 commits intomainfrom Oct 17, 2025
Merged
iio: adc: ad9081: use guard(mutex) to protect critical sections#2992mhennerich merged 4 commits intomainfrom
mhennerich merged 4 commits intomainfrom
Conversation
Add guard(mutex) to ad9081_status_show() and ad9081_fir_bin_write() to ensure proper locking when accessing converter state. This prevents potential race conditions during debugfs interactions. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
nunojsa
approved these changes
Oct 17, 2025
Ensure the return value of sysfs_emit() is properly checked in ad9081_ext_info_read() to catch cases where no data is written or an error occurs. This prevents misleading success returns when the buffer emission fails. Set ret = -EINVAL if sysfs_emit() returns zero or a negative value, aligning with expected error handling practices in sysfs attribute reads. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Convert all instances of for_each_child_of_node() to for_each_child_of_node_scoped() in the ad9081_parse_dt_tx() and ad9081_parse_dt_rx() functions. This ensures proper reference counting and automatic cleanup of child nodes, reducing the risk of memory leaks or dangling references. This change also removes redundant of_node_put() calls for child nodes, as for_each_child_of_node_scoped() handles cleanup automatically. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
The sample rate configuration logic following the call to ad9081_set_sample_rate() was unreachable due to an early return. This patch removes the dead code block that attempted to round and set the clock rate, which is now obsolete and no longer executed. Cleaning up this unreachable code improves readability and avoids confusion about the actual sample rate handling path. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
f750059 to
3cd2468
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Description
Add guard(mutex) to ad9081_status_show() and ad9081_fir_bin_write() to ensure proper locking when accessing converter state. This prevents potential race conditions during debugfs interactions.
PR Type