]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
platform/x86: make fw_attr_class constant
authorRicardo B. Marliere <ricardo@marliere.net>
Tue, 5 Mar 2024 18:55:04 +0000 (15:55 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jul 2025 14:03:09 +0000 (16:03 +0200)
commit9143d22a09b5c11f2f711f07a62bf7f900c60d07
treef0fc43511eaba1700b1592aefd54bb5874cab161
parent3df1e72b7bfed2f5ae0454f5f649e21fc541bef6
platform/x86: make fw_attr_class constant

[ Upstream commit 5878e5b760b6fcf7bc00dec085ba2b439a929871 ]

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 fw_attr_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>
Link: https://lore.kernel.org/r/20240305-class_cleanup-platform-v1-1-9085c97b9355@marliere.net
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Stable-dep-of: 5ff1fbb30597 ("platform/x86: think-lmi: Fix class device unregistration")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/platform/x86/dell/dell-wmi-sysman/sysman.c
drivers/platform/x86/firmware_attributes_class.c
drivers/platform/x86/firmware_attributes_class.h
drivers/platform/x86/hp/hp-bioscfg/bioscfg.c
drivers/platform/x86/think-lmi.c