Skip to content

Commit 4dcc0f9

Browse files
rbmarliereSuzuki K Poulose
authored andcommitted
coresight: 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 coresight_dev_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 <[email protected]> Signed-off-by: Ricardo B. Marliere <[email protected]> Reviewed-by: Anshuman Khandual <[email protected]> Reviewed-by: James Clark <[email protected]> Signed-off-by: Suzuki K Poulose <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Suzuki K Poulose <[email protected]>
1 parent b9b25c8 commit 4dcc0f9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/hwtracing/coresight/coresight-priv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <linux/pm_runtime.h>
1414

1515
extern struct mutex coresight_mutex;
16-
extern struct device_type coresight_dev_type[];
16+
extern const struct device_type coresight_dev_type[];
1717

1818
/*
1919
* Coresight management registers (0xf00-0xfcc)

drivers/hwtracing/coresight/coresight-sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ static struct attribute *coresight_source_attrs[] = {
377377
};
378378
ATTRIBUTE_GROUPS(coresight_source);
379379

380-
struct device_type coresight_dev_type[] = {
380+
const struct device_type coresight_dev_type[] = {
381381
[CORESIGHT_DEV_TYPE_SINK] = {
382382
.name = "sink",
383383
.groups = coresight_sink_groups,

0 commit comments

Comments
 (0)