net: hns: make hnae_class constant
authorRicardo B. Marliere <ricardo@marliere.net>
Sat, 2 Mar 2024 17:05:57 +0000 (14:05 -0300)
committerJakub Kicinski <kuba@kernel.org>
Tue, 5 Mar 2024 19:21:17 +0000 (11:21 -0800)
commitb6e3c115efb5bec0542508a9120b99960073870f
treef1f9d1b16d72dcf47cf8a0ba75ce332d0af11f3e
parente8efd372b2f9d2286fed9ef810430a1d6a37bcba
net: hns: make hnae_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 hnae_class structure to be declared at build time
placing it into read-only memory, instead of having to be dynamically
allocated at boot time.

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240302-class_cleanup-net-next-v1-1-8fa378595b93@marliere.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/hisilicon/hns/hnae.c