diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-12-16 02:04:49 -0800 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-12-16 02:04:49 -0800 |
commit | 348324c5b10bcba8d9daabdfb85a6927311be34f (patch) | |
tree | d06ca3a264407a14a1f36c1b798d6dc0dc1582d8 /drivers/iio/dac/max517.c | |
parent | 1e63bd9cc43db5400a1423a7ec8266b4e7c54bd0 (diff) | |
parent | 319e2e3f63c348a9b66db4667efa73178e18b17d (diff) |
Merge tag 'v3.13-rc4' into next
Synchronize with mainline to bring in the new keycode definitions and
new hwmon API.
Diffstat (limited to 'drivers/iio/dac/max517.c')
-rw-r--r-- | drivers/iio/dac/max517.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/iio/dac/max517.c b/drivers/iio/dac/max517.c index 83adcbf1a20..6e190353795 100644 --- a/drivers/iio/dac/max517.c +++ b/drivers/iio/dac/max517.c @@ -82,15 +82,13 @@ static int max517_read_raw(struct iio_dev *indio_dev, long m) { struct max517_data *data = iio_priv(indio_dev); - unsigned int scale_uv; switch (m) { case IIO_CHAN_INFO_SCALE: /* Corresponds to Vref / 2^(bits) */ - scale_uv = (data->vref_mv[chan->channel] * 1000) >> 8; - *val = scale_uv / 1000000; - *val2 = scale_uv % 1000000; - return IIO_VAL_INT_PLUS_MICRO; + *val = data->vref_mv[chan->channel]; + *val2 = 8; + return IIO_VAL_FRACTIONAL_LOG2; default: break; } @@ -162,7 +160,6 @@ static int max517_probe(struct i2c_client *client, struct max517_data *data; struct iio_dev *indio_dev; struct max517_platform_data *platform_data = client->dev.platform_data; - int err; indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data)); if (!indio_dev) @@ -194,13 +191,7 @@ static int max517_probe(struct i2c_client *client, data->vref_mv[1] = platform_data->vref_mv[1]; } - err = iio_device_register(indio_dev); - if (err) - return err; - - dev_info(&client->dev, "DAC registered\n"); - - return 0; + return iio_device_register(indio_dev); } static int max517_remove(struct i2c_client *client) |