diff options
Diffstat (limited to 'drivers/staging/iio/dds/ad9834.c')
-rw-r--r-- | drivers/staging/iio/dds/ad9834.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/iio/dds/ad9834.c b/drivers/staging/iio/dds/ad9834.c index fe461199801e..c468f696fe25 100644 --- a/drivers/staging/iio/dds/ad9834.c +++ b/drivers/staging/iio/dds/ad9834.c @@ -417,13 +417,13 @@ static int __devexit ad9834_remove(struct spi_device *spi) { struct iio_dev *indio_dev = spi_get_drvdata(spi); struct ad9834_state *st = iio_priv(indio_dev); - struct regulator *reg = st->reg; iio_device_unregister(indio_dev); - if (!IS_ERR(reg)) { - regulator_disable(reg); - regulator_put(reg); + if (!IS_ERR(st->reg)) { + regulator_disable(st->reg); + regulator_put(st->reg); } + iio_free_device(indio_dev); return 0; } |