diff options
author | Jonathan Cameron <jic23@kernel.org> | 2013-09-08 09:57:00 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-09-15 12:43:20 -0400 |
commit | 3704432fb1fd8ab2df114bad6df752381246b609 (patch) | |
tree | 554c46e264866bc2be767434586a68bf5ed7c75c /drivers/iio/dac/ad5624r_spi.c | |
parent | 9761696f2be276b169b77bcf359bc50a251c9280 (diff) |
iio: refactor info mask and ext_info attribute creation.
Introduce an enum to specify whether the attribute is separate or
shared.
Factor out the bitmap handling for loop into a separate function.
Tidy up error handling and add a NULL assignment to squish a false
positive warning from GCC.
Change ext_info shared type from boolean to enum and update in all
drivers.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Diffstat (limited to 'drivers/iio/dac/ad5624r_spi.c')
-rw-r--r-- | drivers/iio/dac/ad5624r_spi.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/iio/dac/ad5624r_spi.c b/drivers/iio/dac/ad5624r_spi.c index 714af757cd56..dbb1289cc7a6 100644 --- a/drivers/iio/dac/ad5624r_spi.c +++ b/drivers/iio/dac/ad5624r_spi.c | |||
@@ -163,8 +163,10 @@ static const struct iio_chan_spec_ext_info ad5624r_ext_info[] = { | |||
163 | .name = "powerdown", | 163 | .name = "powerdown", |
164 | .read = ad5624r_read_dac_powerdown, | 164 | .read = ad5624r_read_dac_powerdown, |
165 | .write = ad5624r_write_dac_powerdown, | 165 | .write = ad5624r_write_dac_powerdown, |
166 | .shared = IIO_SEPARATE, | ||
166 | }, | 167 | }, |
167 | IIO_ENUM("powerdown_mode", true, &ad5624r_powerdown_mode_enum), | 168 | IIO_ENUM("powerdown_mode", IIO_SHARED_BY_TYPE, |
169 | &ad5624r_powerdown_mode_enum), | ||
168 | IIO_ENUM_AVAILABLE("powerdown_mode", &ad5624r_powerdown_mode_enum), | 170 | IIO_ENUM_AVAILABLE("powerdown_mode", &ad5624r_powerdown_mode_enum), |
169 | { }, | 171 | { }, |
170 | }; | 172 | }; |