Re: [PATCH 2/2] tty: vc_screen: make vc_class constant

From: Jiri Slaby
Date: Mon Oct 09 2023 - 01:28:11 EST


On 05. 10. 23, 15:33, Greg Kroah-Hartman wrote:
Now that the driver core allows for struct class to be in read-only
memory, making all 'class' structures to be declared at build time
placing them into read-only memory, instead of having to be dynamically
allocated at load time.

Cc: Jiri Slaby <jirislaby@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
drivers/tty/vt/vc_screen.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c
index 829c4be66f3b..b16ea517bb17 100644
--- a/drivers/tty/vt/vc_screen.c
+++ b/drivers/tty/vt/vc_screen.c
...
@@ -811,11 +810,12 @@ int __init vcs_init(void)
if (register_chrdev(VCS_MAJOR, "vcs", &vcs_fops))
panic("unable to get major %d for vcs device", VCS_MAJOR);
- vc_class = class_create("vc");
+ if (class_register(&vc_class))
+ panic("unable to create vc_class");

FWIW it's no longer "create". Now it's "register".

Anyway, for the sake of archives:
Reviewed-by: Jiri Slaby <jirislaby@xxxxxxxxxx>

regards,
--
js
suse labs