Skip to content
Snippets Groups Projects
Commit e0363c07 authored by Ricardo B. Marliere's avatar Ricardo B. Marliere Committed by William Breathitt Gray
Browse files

counter: constify the struct device_type usage


Since commit aed65af1 ("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: default avatar"Ricardo B. Marliere" <ricardo@marliere.net>
Link: https://lore.kernel.org/r/20240219-device_cleanup-counter-v1-1-24d0316ae815@marliere.net


Signed-off-by: default avatarWilliam Breathitt Gray <william.gray@linaro.org>
parent 6b0828ca
No related branches found
No related tags found
No related merge requests found
...@@ -49,7 +49,7 @@ static void counter_device_release(struct device *dev) ...@@ -49,7 +49,7 @@ static void counter_device_release(struct device *dev)
kfree(container_of(counter, struct counter_device_allochelper, counter)); 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", .name = "counter_device",
.release = counter_device_release, .release = counter_device_release,
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment