diff options
author | Ricardo B. Marliere <ricardo@marliere.net> | 2024-02-19 09:40:50 -0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-03-06 14:13:10 +0000 |
commit | e869b72b33731063b50433eb6146d51a479995a1 (patch) | |
tree | 5ea50d5c6a7c8e310c9aa1e5cfd964fa64cb1a30 /drivers/greybus/control.c | |
parent | 00b9850e7307ff690639dd0584a50dd8a72d3548 (diff) | |
download | lwn-e869b72b33731063b50433eb6146d51a479995a1.tar.gz lwn-e869b72b33731063b50433eb6146d51a479995a1.zip |
greybus: constify the struct device_type usage
Since commit aed65af1cc2f ("drivers: make device_type const"), the driver
core can properly handle constant struct device_type. Move the
greybus_hd_type, greybus_module_type, greybus_interface_type,
greybus_control_type, greybus_bundle_type and greybus_svc_type variables to
be constant structures as well, placing it into read-only memory which can
not be modified at runtime.
Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net>
Reviewed-by: Alex Elder <elder@linaro.org>
Link: https://lore.kernel.org/r/20240219-device_cleanup-greybus-v1-1-babb3f65e8cc@marliere.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/greybus/control.c')
-rw-r--r-- | drivers/greybus/control.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/greybus/control.c b/drivers/greybus/control.c index 359a25841973..b5cf49d09df2 100644 --- a/drivers/greybus/control.c +++ b/drivers/greybus/control.c @@ -436,7 +436,7 @@ static void gb_control_release(struct device *dev) kfree(control); } -struct device_type greybus_control_type = { +const struct device_type greybus_control_type = { .name = "greybus_control", .release = gb_control_release, }; |