[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140803095658.GA6753@himangi-Dell>
Date: Sun, 3 Aug 2014 15:26:58 +0530
From: Himangi Saraogi <himangi774@...il.com>
To: Jonathan Cameron <jic23@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-iio@...r.kernel.org, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Cc: julia.lawall@...6.fr
Subject: [PATCH] staging: iio: ad9832: Use devm_iio_device_register
This patch introduces the use of devm_iio_device_register and does away
with the unregister in the remove function.
Signed-off-by: Himangi Saraogi <himangi774@...il.com>
Acked-by: Julia Lawall <julia.lawall@...6.fr>
---
drivers/staging/iio/frequency/ad9832.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/iio/frequency/ad9832.c b/drivers/staging/iio/frequency/ad9832.c
index cf68159..8a72c78 100644
--- a/drivers/staging/iio/frequency/ad9832.c
+++ b/drivers/staging/iio/frequency/ad9832.c
@@ -304,7 +304,7 @@ static int ad9832_probe(struct spi_device *spi)
if (ret)
goto error_disable_reg;
- ret = iio_device_register(indio_dev);
+ ret = devm_iio_device_register(&spi->dev, indio_dev);
if (ret)
goto error_disable_reg;
@@ -322,7 +322,6 @@ static int ad9832_remove(struct spi_device *spi)
struct iio_dev *indio_dev = spi_get_drvdata(spi);
struct ad9832_state *st = iio_priv(indio_dev);
- iio_device_unregister(indio_dev);
if (!IS_ERR(st->reg))
regulator_disable(st->reg);
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists