From: David Lechner <dlechner@baylibre.com>
To: "Salah Triki" <salah.triki@gmail.com>,
"Lars-Peter Clausen" <lars@metafoo.de>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
linux-iio@vger.kernel.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: iio: adc: ad7816: Use spi_set_drvdata() for clarity
Date: Tue, 19 Aug 2025 09:12:59 -0500 [thread overview]
Message-ID: <6b915b3a-8e6d-485a-9050-474bce154fec@baylibre.com> (raw)
In-Reply-To: <aKRigf3TtH-x-i1C@pc>
On 8/19/25 6:39 AM, Salah Triki wrote:
> Replace the use of `dev_set_drvdata()` with the `spi_set_drvdata()`
> helper. This is functionally identical, but improves readability.
>
> Signed-off-by: Salah Triki <salah.triki@gmail.com>
> ---
> drivers/staging/iio/adc/ad7816.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/iio/adc/ad7816.c b/drivers/staging/iio/adc/ad7816.c
> index 4774df778de9..599f75103cb0 100644
> --- a/drivers/staging/iio/adc/ad7816.c
> +++ b/drivers/staging/iio/adc/ad7816.c
> @@ -360,7 +360,7 @@ static int ad7816_probe(struct spi_device *spi_dev)
> return -ENOMEM;
> chip = iio_priv(indio_dev);
> /* this is only used for device removal purposes */
This comment is no longer true. The driver does not have a .remove
callback. So we can just remove the comment and the dev_set_drvdata().
> - dev_set_drvdata(&spi_dev->dev, indio_dev);
> + spi_set_drvdata(spi_dev, indio_dev);
>
> chip->spi_dev = spi_dev;
> for (i = 0; i <= AD7816_CS_MAX; i++)
prev parent reply other threads:[~2025-08-19 14:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-19 11:39 [PATCH] staging: iio: adc: ad7816: Use spi_set_drvdata() for clarity Salah Triki
2025-08-19 14:12 ` David Lechner [this message]
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=6b915b3a-8e6d-485a-9050-474bce154fec@baylibre.com \
--to=dlechner@baylibre.com \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=nuno.sa@analog.com \
--cc=salah.triki@gmail.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