[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20240219-device_cleanup-drm-v1-3-e2f2acb38bff@marliere.net>
Date: Mon, 19 Feb 2024 09:00:53 -0300
From: "Ricardo B. Marliere" <ricardo@...liere.net>
To: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>, Daniel Vetter <daniel@...ll.ch>,
Hans de Goede <hdegoede@...hat.com>
Cc: dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Ricardo B. Marliere" <ricardo@...liere.net>
Subject: [PATCH drm-misc 3/3] drm/sysfs: 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
drm_sysfs_device_minor and drm_sysfs_device_connector variables to be
constant structures as well, placing it into read-only memory which can not
be modified at runtime.
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@...liere.net>
---
drivers/gpu/drm/drm_sysfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
index a953f69a34b6..6d72dfc4b25a 100644
--- a/drivers/gpu/drm/drm_sysfs.c
+++ b/drivers/gpu/drm/drm_sysfs.c
@@ -50,11 +50,11 @@
* drm_connector_unregister().
*/
-static struct device_type drm_sysfs_device_minor = {
+static const struct device_type drm_sysfs_device_minor = {
.name = "drm_minor"
};
-static struct device_type drm_sysfs_device_connector = {
+static const struct device_type drm_sysfs_device_connector = {
.name = "drm_connector",
};
--
2.43.0
Powered by blists - more mailing lists