* [PATCH] fsi: core: make fsi_bus_type const
@ 2024-02-08 20:05 Ricardo B. Marliere
2024-02-09 10:31 ` Greg Kroah-Hartman
0 siblings, 1 reply; 3+ messages in thread
From: Ricardo B. Marliere @ 2024-02-08 20:05 UTC (permalink / raw)
To: Jeremy Kerr, Joel Stanley, Alistar Popple, Eddie James
Cc: linux-fsi, linux-kernel, Greg Kroah-Hartman, Ricardo B. Marliere
Now that the driver core can properly handle constant struct bus_type,
move the fsi_bus_type variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
---
drivers/fsi/fsi-core.c | 2 +-
include/linux/fsi.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c
index 097d5a780264..f0ffc2cbcbdf 100644
--- a/drivers/fsi/fsi-core.c
+++ b/drivers/fsi/fsi-core.c
@@ -1404,7 +1404,7 @@ void fsi_driver_unregister(struct fsi_driver *fsi_drv)
}
EXPORT_SYMBOL_GPL(fsi_driver_unregister);
-struct bus_type fsi_bus_type = {
+const struct bus_type fsi_bus_type = {
.name = "fsi",
.match = fsi_bus_match,
};
diff --git a/include/linux/fsi.h b/include/linux/fsi.h
index 3df8c54868df..e4b1ae7a2234 100644
--- a/include/linux/fsi.h
+++ b/include/linux/fsi.h
@@ -68,7 +68,7 @@ extern int fsi_slave_read(struct fsi_slave *slave, uint32_t addr,
extern int fsi_slave_write(struct fsi_slave *slave, uint32_t addr,
const void *val, size_t size);
-extern struct bus_type fsi_bus_type;
+extern const struct bus_type fsi_bus_type;
extern const struct device_type fsi_cdev_type;
enum fsi_dev_type {
---
base-commit: c5eeb63edac9497f9a0d46d3b75cf8b293771ecf
change-id: 20240208-bus_cleanup-fsi-e5e7526703ed
Best regards,
--
Ricardo B. Marliere <ricardo@marliere.net>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] fsi: core: make fsi_bus_type const
2024-02-08 20:05 [PATCH] fsi: core: make fsi_bus_type const Ricardo B. Marliere
@ 2024-02-09 10:31 ` Greg Kroah-Hartman
2024-02-09 22:39 ` Eddie James
0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2024-02-09 10:31 UTC (permalink / raw)
To: Ricardo B. Marliere
Cc: Jeremy Kerr, Joel Stanley, Alistar Popple, Eddie James,
linux-fsi, linux-kernel
On Thu, Feb 08, 2024 at 05:05:29PM -0300, Ricardo B. Marliere wrote:
> Now that the driver core can properly handle constant struct bus_type,
> move the fsi_bus_type variable to be a constant structure as well,
> placing it into read-only memory which can not be modified at runtime.
>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fsi: core: make fsi_bus_type const
2024-02-09 10:31 ` Greg Kroah-Hartman
@ 2024-02-09 22:39 ` Eddie James
0 siblings, 0 replies; 3+ messages in thread
From: Eddie James @ 2024-02-09 22:39 UTC (permalink / raw)
To: Greg Kroah-Hartman, Ricardo B. Marliere
Cc: Jeremy Kerr, Joel Stanley, Alistar Popple, linux-fsi, linux-kernel
On 2/9/24 04:31, Greg Kroah-Hartman wrote:
> On Thu, Feb 08, 2024 at 05:05:29PM -0300, Ricardo B. Marliere wrote:
>> Now that the driver core can properly handle constant struct bus_type,
>> move the fsi_bus_type variable to be a constant structure as well,
>> placing it into read-only memory which can not be modified at runtime.
>>
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Thanks.
Reviewed-by: Eddie James <eajames@linux.ibm.com>
> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-02-09 22:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-08 20:05 [PATCH] fsi: core: make fsi_bus_type const Ricardo B. Marliere
2024-02-09 10:31 ` Greg Kroah-Hartman
2024-02-09 22:39 ` Eddie James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®