diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-06-08 10:54:32 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-13 01:48:39 +0400 |
commit | 1a135d1ab5e3122ab2a50cbbdb9cb1504c1f421f (patch) | |
tree | 50de49246b892dd7152e434b7603f1fb3489ff7c | |
parent | e86ee142a223ec85efda7c66b3e99fe79aa8cc4f (diff) | |
download | linux-1a135d1ab5e3122ab2a50cbbdb9cb1504c1f421f.tar.xz |
iio: frequency: adf4350: using an uninitialized variable
GCC complains that we use an uninitialized variable if the user passes
an invalid parameter to adf4350_read(). I decided that we should return
-EINVAL instead in that case.
However, when I looked up at adf4350_write() it returned -ENODEV for
that condition. In the end, I decided the -EINVAL was the right thing
and I change adf4350_write() to match.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/iio/frequency/adf4350.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/frequency/adf4350.c b/drivers/iio/frequency/adf4350.c index 6ce45f5c0deb..59fbb3ae40e7 100644 --- a/drivers/iio/frequency/adf4350.c +++ b/drivers/iio/frequency/adf4350.c @@ -272,7 +272,7 @@ static ssize_t adf4350_write(struct iio_dev *indio_dev, adf4350_sync_config(st); break; default: - ret = -ENODEV; + ret = -EINVAL; } mutex_unlock(&indio_dev->mlock); @@ -311,7 +311,7 @@ static ssize_t adf4350_read(struct iio_dev *indio_dev, val = !!(st->regs[ADF4350_REG2] & ADF4350_REG2_POWER_DOWN_EN); break; default: - ret = -ENODEV; + ret = -EINVAL; } mutex_unlock(&indio_dev->mlock); |