projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
38dca04
)
spi: Constify spi parameters of chip select APIs
author
Geert Uytterhoeven
<geert+renesas@glider.be>
Mon, 13 Mar 2023 10:58:37 +0000
(11:58 +0100)
committer
Mark Brown
<broonie@kernel.org>
Mon, 13 Mar 2023 14:09:06 +0000
(14:09 +0000)
The "spi" parameters of spi_get_chipselect() and spi_get_csgpiod() can
be const.
Fixes: 303feb3cc06ac066 ("spi: Add APIs in spi core to set/get spi->chip_select and spi->cs_gpiod")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link:
https://lore.kernel.org/r/b112de79e7a1e9095a3b6ff22b639f39e39d7748.1678704562.git.geert+renesas@glider.be
Signed-off-by: Mark Brown <broonie@kernel.org>
include/linux/spi/spi.h
patch
|
blob
|
history
diff --git
a/include/linux/spi/spi.h
b/include/linux/spi/spi.h
index e09a61dd34594330ce4b770582eb99b4bdf4a305..74bff5a2f53d36ccf3fe54fc3cbaaf901f8ddb15 100644
(file)
--- a/
include/linux/spi/spi.h
+++ b/
include/linux/spi/spi.h
@@
-266,7
+266,7
@@
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;
}