diff options
author | Mark Brown <broonie@kernel.org> | 2023-03-13 18:19:31 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-03-13 18:19:31 +0000 |
commit | 4d8ff713e684ea58111a33ea7df2e7ddc30683cc (patch) | |
tree | 1c712cbe67882f338274e77dbf92246bda96fb9f /include/linux/spi/spi.h | |
parent | 0762875674b969e35371ec5fe4b594d7a92ab364 (diff) | |
parent | 7859ad5a401b73bf2ddfa274950b5722492c3150 (diff) | |
download | linux-4d8ff713e684ea58111a33ea7df2e7ddc30683cc.tar.gz linux-4d8ff713e684ea58111a33ea7df2e7ddc30683cc.tar.bz2 linux-4d8ff713e684ea58111a33ea7df2e7ddc30683cc.zip |
spi: struct spi_device constification
Merge series from Geert Uytterhoeven <geert+renesas@glider.be>:
After noticing new cases of casting away constness, I went over all
spi_get_*() functions and their callers, and made the following changes:
1. Make all pointer parameters const where possible,
2. Remove unneeded casts, some not even related to constness.
Diffstat (limited to 'include/linux/spi/spi.h')
-rw-r--r-- | include/linux/spi/spi.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index bdb35a91b4bf..74bff5a2f53d 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -244,7 +244,7 @@ static inline void spi_dev_put(struct spi_device *spi) } /* ctldata is for the bus_controller driver's runtime state */ -static inline void *spi_get_ctldata(struct spi_device *spi) +static inline void *spi_get_ctldata(const struct spi_device *spi) { return spi->controller_state; } @@ -261,12 +261,12 @@ 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); } -static inline u8 spi_get_chipselect(struct spi_device *spi, u8 idx) +static inline u8 spi_get_chipselect(const struct spi_device *spi, u8 idx) { return spi->chip_select; } @@ -276,7 +276,7 @@ static inline void spi_set_chipselect(struct spi_device *spi, u8 idx, u8 chipsel spi->chip_select = chipselect; } -static inline struct gpio_desc *spi_get_csgpiod(struct spi_device *spi, u8 idx) +static inline struct gpio_desc *spi_get_csgpiod(const struct spi_device *spi, u8 idx) { return spi->cs_gpiod; } |