diff options
author | Ricardo B. Marliere <ricardo@marliere.net> | 2024-03-02 14:06:02 -0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-03-05 11:21:18 -0800 |
commit | e5560011692981bc8bfeae7fc0673c65a02badba (patch) | |
tree | cd04c9f66b685134b85b2f127b59cf742c479a97 /net/nfc/core.c | |
parent | 070bef83f03ea9d91a8011f18113f8967e3df5bf (diff) |
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 'net/nfc/core.c')
-rw-r--r-- | net/nfc/core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/nfc/core.c b/net/nfc/core.c index eb2c0959e5b6..e58dc6405054 100644 --- a/net/nfc/core.c +++ b/net/nfc/core.c @@ -1015,7 +1015,7 @@ static void nfc_check_pres_timeout(struct timer_list *t) schedule_work(&dev->check_pres_work); } -struct class nfc_class = { +const struct class nfc_class = { .name = "nfc", .dev_release = nfc_release, }; |