mtd: ubi: make ubi_class constant
authorRicardo B. Marliere <ricardo@marliere.net>
Tue, 5 Mar 2024 19:35:38 +0000 (16:35 -0300)
committerRichard Weinberger <richard@nod.at>
Fri, 12 Jul 2024 17:45:09 +0000 (19:45 +0200)
commit299af26eb46374295a3289be990e536b75c9376a
treee253939a33617c37bbe7f9ef742cca1c6160a199
parent745d9f4a31defec731119ee8aad8ba9f2536dd9a
mtd: ubi: make ubi_class constant

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 ubi_class structure to be declared at build time
placing it 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>
Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
drivers/mtd/ubi/build.c
drivers/mtd/ubi/ubi.h