Skip to content

Commit aaf2230

Browse files
rbmarlieretsbogend
authored andcommitted
tc: make tc_bus_type const
Since commit d492cc2 ("driver core: device.h: make struct bus_type a const *"), the driver core can properly handle constant struct bus_type, move the tc_bus_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]> Suggested-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Ricardo B. Marliere <[email protected]> Acked-by: Maciej W. Rozycki <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent 1003a1a commit aaf2230

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/tc/tc-driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static int tc_bus_match(struct device *dev, struct device_driver *drv)
9595
return 0;
9696
}
9797

98-
struct bus_type tc_bus_type = {
98+
const struct bus_type tc_bus_type = {
9999
.name = "tc",
100100
.match = tc_bus_match,
101101
};

include/linux/tc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ static inline unsigned long tc_get_speed(struct tc_bus *tbus)
120120

121121
#ifdef CONFIG_TC
122122

123-
extern struct bus_type tc_bus_type;
123+
extern const struct bus_type tc_bus_type;
124124

125125
extern int tc_register_driver(struct tc_driver *tdrv);
126126
extern void tc_unregister_driver(struct tc_driver *tdrv);

0 commit comments

Comments
 (0)