Skip to content

Commit

Permalink
accel: constify the struct device_type usage
Browse files Browse the repository at this point in the history
Since commit aed65af ("drivers: make device_type const"), the driver
core can properly handle constant struct device_type. Move the
accel_sysfs_device_minor 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>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
  • Loading branch information
Ricardo B. Marliere authored and Oded Gabbay committed Feb 26, 2024
1 parent fa58b59 commit 576d7cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/accel/drm_accel.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ static struct idr accel_minors_idr;

static struct dentry *accel_debugfs_root;

static struct device_type accel_sysfs_device_minor = {
static const struct device_type accel_sysfs_device_minor = {
.name = "accel_minor"
};

Expand Down

0 comments on commit 576d7cc

Please sign in to comment.