Skip to content

Commit 8dc0b2d

Browse files
rbmarlieregregkh
authored andcommitted
intel_th: Constify the struct device_type usage
Since commit aed65af ("drivers: make device_type const"), the driver core can properly handle constant struct device_type. Move the intel_th_source_device_type, intel_th_output_device_type, intel_th_switch_device_type and intel_th_device_type variables to be constant structures as well, placing it into read-only memory which can not be modified at runtime. Signed-off-by: "Ricardo B. Marliere" <[email protected]> Signed-off-by: Alexander Shishkin <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 1592e84 commit 8dc0b2d

File tree

1 file changed

+4
-4
lines changed
  • drivers/hwtracing/intel_th

1 file changed

+4
-4
lines changed

drivers/hwtracing/intel_th/core.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ static void intel_th_device_release(struct device *dev)
180180
intel_th_device_free(to_intel_th_device(dev));
181181
}
182182

183-
static struct device_type intel_th_source_device_type = {
183+
static const struct device_type intel_th_source_device_type = {
184184
.name = "intel_th_source_device",
185185
.release = intel_th_device_release,
186186
};
@@ -333,19 +333,19 @@ static struct attribute *intel_th_output_attrs[] = {
333333

334334
ATTRIBUTE_GROUPS(intel_th_output);
335335

336-
static struct device_type intel_th_output_device_type = {
336+
static const struct device_type intel_th_output_device_type = {
337337
.name = "intel_th_output_device",
338338
.groups = intel_th_output_groups,
339339
.release = intel_th_device_release,
340340
.devnode = intel_th_output_devnode,
341341
};
342342

343-
static struct device_type intel_th_switch_device_type = {
343+
static const struct device_type intel_th_switch_device_type = {
344344
.name = "intel_th_switch_device",
345345
.release = intel_th_device_release,
346346
};
347347

348-
static struct device_type *intel_th_device_type[] = {
348+
static const struct device_type *intel_th_device_type[] = {
349349
[INTEL_TH_SOURCE] = &intel_th_source_device_type,
350350
[INTEL_TH_OUTPUT] = &intel_th_output_device_type,
351351
[INTEL_TH_SWITCH] = &intel_th_switch_device_type,

0 commit comments

Comments
 (0)