From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: broonie@kernel.org
Cc: linux-kernel@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-spi@vger.kernel.org
Subject: [PATCH] spi: make spi_bus_type const
Date: Fri, 5 Jan 2024 11:32:50 +0100 [thread overview]
Message-ID: <2024010549-erasure-swoop-1cc6@gregkh> (raw)
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>
---
drivers/spi/spi.c | 2 +-
include/linux/spi/spi.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 8ead7acb99f3..6e962befc450 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -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,
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 255a0562aea5..f6c157dee55d 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -33,7 +33,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
--
2.43.0
next reply other threads:[~2024-01-05 10:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-05 10:32 Greg Kroah-Hartman [this message]
2024-01-05 14:55 ` [PATCH] spi: make spi_bus_type const Mark Brown
2024-01-05 15:05 ` Greg Kroah-Hartman
2024-01-05 15:45 ` Mark Brown
2024-01-05 15:51 ` Greg Kroah-Hartman
2024-01-05 15:59 ` Mark Brown
2024-01-05 16:02 ` Greg Kroah-Hartman
2024-01-22 16:49 ` 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=2024010549-erasure-swoop-1cc6@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
/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).