Commit 768a806
committed
iio: dac: ad5413: Integrate reviewer feedback
This patch addresses various improvements based on reviewer suggestions:
- Removed unused index variable in parse_dt()
- Fixed misleading indentation in probe() conditional blocks
- Reworked DT bindings: switched to enum/oneOf and restricted voltage/current ranges
- Added driver-side range validation for voltage and current modes
- Replaced manual bit macros with FIELD_PREP() for DAC_CONFIG
- Removed unnecessary include: <linux/kernel.h>
- Sorted entries in Kconfig and Makefile
- Quoted DT required property names and simplified mutual-exclusion logic
- Tidied up whitespace, blank lines, and long lines
Signed-off-by: Bruce Tsao <bruce.tsao@analog.com>
iio: dac: ad5413: apply reviewer cleanups
Address various reviewer comments and style fixes:
- Move FIELD_PREP mask definitions directly beneath their register defines
- Replace usleep_range() with fsleep() in wait loops
- Return -ETIMEDOUT on timeout instead of -EIO
- Use dev_err_probe() for probe-time failures in DT parsing
- Rename ad5413_find_closest_match() to ad5413_find_best_match()
- Change out_range to a pointer to avoid per-field copies
- Guard devm_mutex_init() with kernel version check; fall back to mutex_init()
- Remove redundant comments and simplify error paths
- Simplify pwr_down logic with ternary assignment
- Fix indentation, tab/space usage, and other style issues as per checkpatch
Signed-off-by: Bruce Tsao <bruce.tsao@analog.com>
iio: dac: ad5413: final cleanups after style check
Address remaining checkpatch warnings:
- remove trailing '('
- adjust CamelCase enum name
- fix unnecessary parentheses
Signed-off-by: Bruce Tsao <bruce.tsao@analog.com>1 parent def3ac3 commit 768a806
File tree
4 files changed
+223
-239
lines changed- Documentation/devicetree/bindings/iio/dac
- drivers/iio/dac
4 files changed
+223
-239
lines changedLines changed: 13 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | | - | |
31 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | | - | |
35 | | - | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
57 | 52 | | |
58 | 53 | | |
59 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
97 | 107 | | |
98 | 108 | | |
99 | 109 | | |
| |||
563 | 573 | | |
564 | 574 | | |
565 | 575 | | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | 576 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
60 | | - | |
| 61 | + | |
0 commit comments