spi: make spi_bus_type const
Now that the driver core can properly handle constant struct bus_type, move the spi_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. Cc: Mark Brown <broonie@kernel.org> Cc: <linux-spi@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://msgid.link/r/2024010549-erasure-swoop-1cc6@gregkh Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
4247d7f2ca
commit
6df534cc71
@ -459,7 +459,7 @@ static void spi_shutdown(struct device *dev)
|
||||
}
|
||||
}
|
||||
|
||||
struct bus_type spi_bus_type = {
|
||||
const struct bus_type spi_bus_type = {
|
||||
.name = "spi",
|
||||
.dev_groups = spi_dev_groups,
|
||||
.match = spi_match_device,
|
||||
|
@ -36,7 +36,7 @@ struct spi_message;
|
||||
* INTERFACES between SPI master-side drivers and SPI slave protocol handlers,
|
||||
* and SPI infrastructure.
|
||||
*/
|
||||
extern struct bus_type spi_bus_type;
|
||||
extern const struct bus_type spi_bus_type;
|
||||
|
||||
/**
|
||||
* struct spi_statistics - statistics for spi transfers
|
||||
|
Loading…
x
Reference in New Issue
Block a user