From: Jonathan Cameron <jic23@kernel.org>
To: David Lechner <dlechner@baylibre.com>
Cc: "Michael Hennerich" <Michael.Hennerich@analog.com>,
"Liam Girdwood" <lgirdwood@gmail.com>,
"Mark Brown" <broonie@kernel.org>,
"Antoniu Miclaus" <antoniu.miclaus@analog.com>,
"Nuno Sá" <nuno.sa@analog.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 04/11] iio: dac: ad5686: drop driver remove function
Date: Sat, 23 Nov 2024 15:45:44 +0000 [thread overview]
Message-ID: <20241123154544.110eff2c@jic23-huawei> (raw)
In-Reply-To: <20241120-iio-regulator-cleanup-round-6-v1-4-d5a5360f7ec3@baylibre.com>
On Wed, 20 Nov 2024 15:33:27 -0600
David Lechner <dlechner@baylibre.com> wrote:
> Remove driver remove callback for ad5686 SPI and I2C drivers.
>
> By making use of devm_iio_device_register(), we no longer need a driver
> remove callback. Also since this was the last user of dev_get_drvdata(),
> we can drop the call to dev_set_drvdata().
>
> Signed-off-by: David Lechner <dlechner@baylibre.com>
Applied 1-4
> ---
> drivers/iio/dac/ad5686-spi.c | 6 ------
> drivers/iio/dac/ad5686.c | 11 +----------
> drivers/iio/dac/ad5686.h | 2 --
> drivers/iio/dac/ad5696-i2c.c | 6 ------
> 4 files changed, 1 insertion(+), 24 deletions(-)
>
> diff --git a/drivers/iio/dac/ad5686-spi.c b/drivers/iio/dac/ad5686-spi.c
> index 8ba2ea70451a..79cfae7a1048 100644
> --- a/drivers/iio/dac/ad5686-spi.c
> +++ b/drivers/iio/dac/ad5686-spi.c
> @@ -95,11 +95,6 @@ static int ad5686_spi_probe(struct spi_device *spi)
> ad5686_spi_write, ad5686_spi_read);
> }
>
> -static void ad5686_spi_remove(struct spi_device *spi)
> -{
> - ad5686_remove(&spi->dev);
> -}
> -
> static const struct spi_device_id ad5686_spi_id[] = {
> {"ad5310r", ID_AD5310R},
> {"ad5672r", ID_AD5672R},
> @@ -126,7 +121,6 @@ static struct spi_driver ad5686_spi_driver = {
> .name = "ad5686",
> },
> .probe = ad5686_spi_probe,
> - .remove = ad5686_spi_remove,
> .id_table = ad5686_spi_id,
> };
>
> diff --git a/drivers/iio/dac/ad5686.c b/drivers/iio/dac/ad5686.c
> index a8a38879fc40..b848b076851c 100644
> --- a/drivers/iio/dac/ad5686.c
> +++ b/drivers/iio/dac/ad5686.c
> @@ -464,7 +464,6 @@ int ad5686_probe(struct device *dev,
> return -ENOMEM;
>
> st = iio_priv(indio_dev);
> - dev_set_drvdata(dev, indio_dev);
>
> st->dev = dev;
> st->write = write;
> @@ -521,18 +520,10 @@ int ad5686_probe(struct device *dev,
> if (ret)
> return ret;
>
> - return iio_device_register(indio_dev);
> + return devm_iio_device_register(dev, indio_dev);
> }
> EXPORT_SYMBOL_NS_GPL(ad5686_probe, IIO_AD5686);
>
> -void ad5686_remove(struct device *dev)
> -{
> - struct iio_dev *indio_dev = dev_get_drvdata(dev);
> -
> - iio_device_unregister(indio_dev);
> -}
> -EXPORT_SYMBOL_NS_GPL(ad5686_remove, IIO_AD5686);
> -
> MODULE_AUTHOR("Michael Hennerich <michael.hennerich@analog.com>");
> MODULE_DESCRIPTION("Analog Devices AD5686/85/84 DAC");
> MODULE_LICENSE("GPL v2");
> diff --git a/drivers/iio/dac/ad5686.h b/drivers/iio/dac/ad5686.h
> index 62eb309711af..e7d36bae3e59 100644
> --- a/drivers/iio/dac/ad5686.h
> +++ b/drivers/iio/dac/ad5686.h
> @@ -155,7 +155,5 @@ int ad5686_probe(struct device *dev,
> const char *name, ad5686_write_func write,
> ad5686_read_func read);
>
> -void ad5686_remove(struct device *dev);
> -
>
> #endif /* __DRIVERS_IIO_DAC_AD5686_H__ */
> diff --git a/drivers/iio/dac/ad5696-i2c.c b/drivers/iio/dac/ad5696-i2c.c
> index 81541f755a3e..a56a7a410111 100644
> --- a/drivers/iio/dac/ad5696-i2c.c
> +++ b/drivers/iio/dac/ad5696-i2c.c
> @@ -65,11 +65,6 @@ static int ad5686_i2c_probe(struct i2c_client *i2c)
> ad5686_i2c_write, ad5686_i2c_read);
> }
>
> -static void ad5686_i2c_remove(struct i2c_client *i2c)
> -{
> - ad5686_remove(&i2c->dev);
> -}
> -
> static const struct i2c_device_id ad5686_i2c_id[] = {
> {"ad5311r", ID_AD5311R},
> {"ad5337r", ID_AD5337R},
> @@ -116,7 +111,6 @@ static struct i2c_driver ad5686_i2c_driver = {
> .of_match_table = ad5686_of_match,
> },
> .probe = ad5686_i2c_probe,
> - .remove = ad5686_i2c_remove,
> .id_table = ad5686_i2c_id,
> };
>
>
next prev parent reply other threads:[~2024-11-23 15:45 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-20 21:33 [PATCH 00/11] iio: use devm_regulator_get_enable_read_voltage round 6 David Lechner
2024-11-20 21:33 ` [PATCH 01/11] iio: dac: ad5624r: fix struct name in doc comment David Lechner
2024-11-20 21:33 ` [PATCH 02/11] iio: dac: ad5686: " David Lechner
2024-11-20 21:33 ` [PATCH 03/11] iio: dac: ad5686: use devm_regulator_get_enable_read_voltage() David Lechner
2024-11-20 21:33 ` [PATCH 04/11] iio: dac: ad5686: drop driver remove function David Lechner
2024-11-23 15:45 ` Jonathan Cameron [this message]
2024-11-20 21:33 ` [PATCH 05/11] iio: dac: ad7293: use devm_regulator_get_enable_read_voltage() David Lechner
2024-11-23 15:50 ` Jonathan Cameron
2024-11-20 21:33 ` [PATCH 06/11] iio: dac: ad8801: " David Lechner
2024-11-23 15:51 ` Jonathan Cameron
2024-11-20 21:33 ` [PATCH 07/11] iio: dac ad8801: drop driver remove function David Lechner
2024-11-23 15:52 ` Jonathan Cameron
2024-11-20 21:33 ` [PATCH 08/11] iio: dac: ltc2632: use devm_regulator_get_enable_read_voltage() David Lechner
2024-11-23 15:53 ` Jonathan Cameron
2024-11-20 21:33 ` [PATCH 09/11] iio: dac ltc2632: drop driver remove function David Lechner
2024-11-23 15:54 ` Jonathan Cameron
2024-11-20 21:33 ` [PATCH 10/11] iio: dac: ltc2688: use devm_regulator_get_enable_read_voltage() David Lechner
2024-11-23 15:55 ` Jonathan Cameron
2024-11-20 21:33 ` [PATCH 11/11] iio: dac: max5821: " David Lechner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241123154544.110eff2c@jic23-huawei \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=antoniu.miclaus@analog.com \
--cc=broonie@kernel.org \
--cc=dlechner@baylibre.com \
--cc=lgirdwood@gmail.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox