summaryrefslogtreecommitdiffstats
path: root/drivers/iio/adc/ad799x.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iio/adc/ad799x.c')
-rw-r--r--drivers/iio/adc/ad799x.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/iio/adc/ad799x.c b/drivers/iio/adc/ad799x.c
index b757cc45c4..0f0dcd9ca6 100644
--- a/drivers/iio/adc/ad799x.c
+++ b/drivers/iio/adc/ad799x.c
@@ -128,7 +128,7 @@ struct ad799x_state {
struct regulator *vref;
/* lock to protect against multiple access to the device */
struct mutex lock;
- unsigned id;
+ unsigned int id;
u16 config;
u8 *rx_buf;
@@ -253,7 +253,7 @@ static int ad799x_update_scan_mode(struct iio_dev *indio_dev,
}
}
-static int ad799x_scan_direct(struct ad799x_state *st, unsigned ch)
+static int ad799x_scan_direct(struct ad799x_state *st, unsigned int ch)
{
u8 cmd;
@@ -335,6 +335,7 @@ static ssize_t ad799x_read_frequency(struct device *dev,
struct ad799x_state *st = iio_priv(indio_dev);
int ret = i2c_smbus_read_byte_data(st->client, AD7998_CYCLE_TMR_REG);
+
if (ret < 0)
return ret;
@@ -523,7 +524,7 @@ done:
return IRQ_HANDLED;
}
-static IIO_DEV_ATTR_SAMP_FREQ(S_IWUSR | S_IRUGO,
+static IIO_DEV_ATTR_SAMP_FREQ(0644,
ad799x_read_frequency,
ad799x_write_frequency);
static IIO_CONST_ATTR_SAMP_FREQ_AVAIL("15625 7812 3906 1953 976 488 244 0");