Skip to content

Commit a675cd1

Browse files
committed
iio: dac: Fix issues in AD5413 driver based on review
Signed-off-by: Bruce Tsao <[email protected]>
1 parent fba488a commit a675cd1

File tree

2 files changed

+6
-19
lines changed

2 files changed

+6
-19
lines changed

drivers/iio/dac/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ config AD5413
102102
Digital to Analog Converter.
103103

104104
To compile this driver as a module, choose M here: the
105-
module will be called ad5758.
105+
module will be called ad5413.
106106

107107
config AD5421
108108
tristate "Analog Devices AD5421 DAC driver"

drivers/iio/dac/ad5413.c

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@
5050
#define AD5413_REG_FREQ_MONITOR 0x18
5151
#define AD5413_REG_DEVICE_ID_3 0x1C
5252

53-
/* AD5413 Key Register (Address: 0x08) */
54-
#define AD5413_REG_KEY_REG_ADDR_SHIFT 16
55-
5653
/* Special Key Codes (bits[15:0]) */
5754
#define AD5413_REG_KEY_CODE_RESET_1 0x15FA
5855
#define AD5413_REG_KEY_CODE_RESET_2 0xAF51
@@ -73,16 +70,7 @@ struct ad5413_range {
7370
int max_uv;
7471
};
7572

76-
/**
77-
* struct ad5413_state - driver instance specific data
78-
* @spi: spi_device
79-
* @lock: mutex lock
80-
* @gpio_reset: gpio descriptor for the reset line
81-
* @out_range: struct which stores the output range
82-
* @slew_time: variable which stores the target slew time
83-
* @pwr_down: variable which contains whether a channel is powered down or not
84-
* @d32: spi transfer buffers
85-
*/
73+
/* struct ad5413_state - driver instance specific data */
8674
struct ad5413_state {
8775
struct spi_device *spi;
8876
struct mutex lock; /* Protects all register access via SPI */
@@ -384,9 +372,8 @@ static int ad5413_reg_access(struct iio_dev *indio_dev,
384372
guard(mutex)(&st->lock);
385373
if (readval) {
386374
ret = ad5413_spi_reg_read(st, reg);
387-
if (ret < 0) {
375+
if (ret < 0)
388376
return ret;
389-
}
390377

391378
*readval = ret;
392379
ret = 0;
@@ -562,7 +549,7 @@ static int ad5413_parse_dt(struct ad5413_state *st)
562549
const struct ad5413_range *ranges;
563550
int ret;
564551

565-
/* 1) voltage or current range */
552+
/* 1) voltage or current range */
566553
ret = device_property_read_u32_array(&st->spi->dev,
567554
"adi,range-microvolt",
568555
tmparray, 2);
@@ -592,15 +579,15 @@ static int ad5413_parse_dt(struct ad5413_state *st)
592579
size = ARRAY_SIZE(ad5413_current_range);
593580
}
594581

595-
/* 2) find_out_range() and st->out_range */
582+
/* 2) find_out_range() and st->out_range */
596583
ret = ad5413_find_out_range(st, ranges, size,
597584
tmparray[0], tmparray[1]);
598585
if (ret < 0)
599586
return dev_err_probe(&st->spi->dev, ret,
600587
"Invalid range values (%u, %u)\n",
601588
tmparray[0], tmparray[1]);
602589

603-
/* 3) read slew-time (optional) */
590+
/* 3) read slew-time (optional) */
604591
ret = device_property_read_u32(&st->spi->dev,
605592
"adi,slew-time-us", &slew_time_us);
606593
if (ret == -ENODATA || ret == -EINVAL) {

0 commit comments

Comments
 (0)