usb: typec: constify struct class usage
authorRicardo B. Marliere <ricardo@marliere.net>
Fri, 1 Mar 2024 21:19:28 +0000 (18:19 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 2 Mar 2024 19:21:06 +0000 (20:21 +0100)
commitc40b51b3f365f6bc903719acc4fac7eed8a56639
tree7befb8ea9d6716cb556a5d618efbe616c740b288
parenta74c0c9c3f7fa6fba34196d142bab93509f17dba
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>
drivers/usb/typec/class.c
drivers/usb/typec/class.h
drivers/usb/typec/mux.c
drivers/usb/typec/retimer.c