From: Geert Uytterhoeven Date: Mon, 13 Mar 2023 10:58:36 +0000 (+0100) Subject: spi: Constify spi_get_drvdata()'s spi parameter X-Git-Tag: v6.4-rc1~124^2~45^2~2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=38dca04d659a422d842f7edcecd32253c7a6fb5e;p=tomoyo%2Ftomoyo-test1.git spi: Constify spi_get_drvdata()'s spi parameter 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 Link: https://lore.kernel.org/r/0f1700ade27a8f3935d04480ff7bef8a887331eb.1678704562.git.geert+renesas@glider.be Signed-off-by: Mark Brown --- diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 6097d2f51266..e09a61dd3459 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); }