summaryrefslogtreecommitdiff
path: root/drivers/counter
diff options
context:
space:
mode:
authorRicardo B. Marliere <ricardo@marliere.net>2024-02-19 16:52:52 -0300
committerWilliam Breathitt Gray <wbg@kernel.org>2024-04-02 13:10:34 -0400
commite0363c0706a187b037c06e1f30b2ac0fb44c31c3 (patch)
treefe3b76b8af3157a4b2a8afe2f1d5d999d6536bf5 /drivers/counter
parent6b0828ca8bd18315647511dfe731101b6a59de2b (diff)
counter: constify the struct device_type usage
Since commit aed65af1cc2f ("drivers: make device_type const"), the driver core can properly handle constant struct device_type. Move the counter_device_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net> Link: https://lore.kernel.org/r/20240219-device_cleanup-counter-v1-1-24d0316ae815@marliere.net Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
Diffstat (limited to 'drivers/counter')
-rw-r--r--drivers/counter/counter-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/counter/counter-core.c b/drivers/counter/counter-core.c
index 29df0985f2ba..893b4f0726d2 100644
--- a/drivers/counter/counter-core.c
+++ b/drivers/counter/counter-core.c
@@ -49,7 +49,7 @@ static void counter_device_release(struct device *dev)
kfree(container_of(counter, struct counter_device_allochelper, counter));
}
-static struct device_type counter_device_type = {
+static const struct device_type counter_device_type = {
.name = "counter_device",
.release = counter_device_release,
};