From: Geert Uytterhoeven <geert+renesas@glider.be>
To: Mark Brown <broonie@kernel.org>, Min Li <min.li.xe@renesas.com>,
Lee Jones <lee@kernel.org>, Vladimir Oltean <olteanv@gmail.com>,
Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>,
Michal Simek <michal.simek@amd.com>
Cc: linux-spi@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
linux-kernel@vger.kernel.org,
Geert Uytterhoeven <geert+renesas@glider.be>
Subject: [PATCH 4/6] spi: Constify spi_get_drvdata()'s spi parameter
Date: Mon, 13 Mar 2023 11:58:36 +0100 [thread overview]
Message-ID: <0f1700ade27a8f3935d04480ff7bef8a887331eb.1678704562.git.geert+renesas@glider.be> (raw)
In-Reply-To: <cover.1678704562.git.geert+renesas@glider.be>
The "spi" parameter of spi_get_drvdata() can be const.
dev_get_drvdata() has been taking a const pointer since commit
7d1d8999b4bec0ba ("i2c: Constify i2c_get_clientdata's parameter").
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
include/linux/spi/spi.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 6097d2f5126624eb..e09a61dd34594330 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -261,7 +261,7 @@ static inline void spi_set_drvdata(struct spi_device *spi, void *data)
dev_set_drvdata(&spi->dev, data);
}
-static inline void *spi_get_drvdata(struct spi_device *spi)
+static inline void *spi_get_drvdata(const struct spi_device *spi)
{
return dev_get_drvdata(&spi->dev);
}
--
2.34.1
next prev parent reply other threads:[~2023-03-13 10:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-13 10:58 [PATCH 0/6] spi: struct spi_device constification Geert Uytterhoeven
2023-03-13 10:58 ` [PATCH 1/6] mfd: rsmu_spi: Remove unneeded casts of void * Geert Uytterhoeven
2023-03-16 16:13 ` Lee Jones
2023-03-13 10:58 ` [PATCH 2/6] spi: fsl-dspi: Remove unneeded cast to same type Geert Uytterhoeven
2023-03-13 10:58 ` [PATCH 3/6] spi: Constify spi_get_ctldata()'s spi parameter Geert Uytterhoeven
2023-03-13 10:58 ` Geert Uytterhoeven [this message]
2023-03-13 10:58 ` [PATCH 5/6] spi: Constify spi parameters of chip select APIs Geert Uytterhoeven
2023-03-13 10:58 ` [PATCH 6/6] spi: sh-msiof: Remove casts to drop constness Geert Uytterhoeven
2023-03-13 18:20 ` (subset) [PATCH 0/6] spi: struct spi_device constification Mark Brown
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=0f1700ade27a8f3935d04480ff7bef8a887331eb.1678704562.git.geert+renesas@glider.be \
--to=geert+renesas@glider.be \
--cc=amit.kumar-mahapatra@amd.com \
--cc=broonie@kernel.org \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=michal.simek@amd.com \
--cc=min.li.xe@renesas.com \
--cc=olteanv@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;
as well as URLs for NNTP newsgroup(s).