Skip to content

Conversation

mhennerich
Copy link
Contributor

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

  • Bug fix (a change that fixes an issue)

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>
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>
@mhennerich mhennerich force-pushed the testing/xlnx/ad9081-fix-debugfs branch from f750059 to 3cd2468 Compare October 17, 2025 10:43
@mhennerich mhennerich merged commit 169dfdb into main Oct 17, 2025
24 of 26 checks passed
@mhennerich mhennerich deleted the testing/xlnx/ad9081-fix-debugfs branch October 17, 2025 11:24
github-actions bot pushed a commit that referenced this pull request Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants