iio: adf4350: fix compiler warning [-Wuninitialized]
authorMichael Hennerich <michael.hennerich@analog.com>
Tue, 5 Jun 2012 09:52:18 +0000 (11:52 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 7 Jun 2012 05:26:28 +0000 (14:26 +0900)
drivers/iio/frequency/adf4350.c:316:32: warning: ‘val’ may be used uninitialized in this function
[-Wuninitialized]

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/frequency/adf4350.c

index fd4c8501aba987aac32cd7d2d9e6469ce5b5f888..2d09f82d97524ec35612d9795b9304e2a81e574c 100644 (file)
@@ -310,6 +310,8 @@ static ssize_t adf4350_read(struct iio_dev *indio_dev,
        case ADF4350_PWRDOWN:
                val = !!(st->regs[ADF4350_REG2] & ADF4350_REG2_POWER_DOWN_EN);
                break;
+       default:
+               ret = -ENODEV;
        }
        mutex_unlock(&indio_dev->mlock);