summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorRicardo B. Marliere <ricardo@marliere.net>2024-03-02 20:06:02 +0300
committerJakub Kicinski <kuba@kernel.org>2024-03-05 22:21:18 +0300
commite5560011692981bc8bfeae7fc0673c65a02badba (patch)
treecd04c9f66b685134b85b2f127b59cf742c479a97 /include/net
parent070bef83f03ea9d91a8011f18113f8967e3df5bf (diff)
downloadlinux-e5560011692981bc8bfeae7fc0673c65a02badba.tar.xz
nfc: core: make nfc_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 nfc_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-6-8fa378595b93@marliere.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/nfc/nfc.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h
index 5dee575fbe86..3d07abacf08b 100644
--- a/include/net/nfc/nfc.h
+++ b/include/net/nfc/nfc.h
@@ -196,7 +196,7 @@ struct nfc_dev {
};
#define to_nfc_dev(_dev) container_of(_dev, struct nfc_dev, dev)
-extern struct class nfc_class;
+extern const struct class nfc_class;
struct nfc_dev *nfc_allocate_device(const struct nfc_ops *ops,
u32 supported_protocols,