diff options
| author | Ricardo B. Marliere <ricardo@marliere.net> | 2024-03-01 18:19:28 -0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-03-02 20:21:06 +0100 |
| commit | c40b51b3f365f6bc903719acc4fac7eed8a56639 (patch) | |
| tree | 7befb8ea9d6716cb556a5d618efbe616c740b288 /drivers/usb/typec/class.h | |
| parent | USB: typec: no opencoding FIELD_GET (diff) | |
| download | linux-c40b51b3f365f6bc903719acc4fac7eed8a56639.tar.gz linux-c40b51b3f365f6bc903719acc4fac7eed8a56639.zip | |
usb: typec: constify struct class usage
Since commit 43a7206b0963 ("driver core: class: make class_register() take
a const *"), the driver core allows for struct class to be in read-only
memory, so move the structures typec_mux_class, retimer_class and
typec_class to be declared at build time placing them into read-only
memory, instead of having to be dynamically allocated at boot time.
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Link: https://lore.kernel.org/r/20240301-class_cleanup-usb-v1-1-50309e325095@marliere.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/typec/class.h')
| -rw-r--r-- | drivers/usb/typec/class.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/typec/class.h b/drivers/usb/typec/class.h index 759b98355eeb..7485cdb9dd20 100644 --- a/drivers/usb/typec/class.h +++ b/drivers/usb/typec/class.h @@ -93,9 +93,9 @@ extern const struct device_type typec_port_dev_type; #define is_typec_plug(dev) ((dev)->type == &typec_plug_dev_type) #define is_typec_port(dev) ((dev)->type == &typec_port_dev_type) -extern struct class typec_mux_class; -extern struct class retimer_class; -extern struct class typec_class; +extern const struct class typec_mux_class; +extern const struct class retimer_class; +extern const struct class typec_class; #if defined(CONFIG_ACPI) int typec_link_ports(struct typec_port *connector); |
