Skip to content

Commit cf497f3

Browse files
rbmarlierevinodkoul
authored andcommitted
dmaengine: idxd: make dsa_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 dsa_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]> Reviewed-by: Dave Jiang <[email protected]> Reviewed-by: Fenghua Yu <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent de7d9cb commit cf497f3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/dma/idxd/bus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static int idxd_bus_uevent(const struct device *dev, struct kobj_uevent_env *env
7272
return add_uevent_var(env, "MODALIAS=" IDXD_DEVICES_MODALIAS_FMT, 0);
7373
}
7474

75-
struct bus_type dsa_bus_type = {
75+
const struct bus_type dsa_bus_type = {
7676
.name = "dsa",
7777
.match = idxd_config_bus_match,
7878
.probe = idxd_config_bus_probe,

drivers/dma/idxd/idxd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ static inline void idxd_set_user_intr(struct idxd_device *idxd, bool enable)
516516
iowrite32(reg.bits, idxd->reg_base + IDXD_GENCFG_OFFSET);
517517
}
518518

519-
extern struct bus_type dsa_bus_type;
519+
extern const struct bus_type dsa_bus_type;
520520

521521
extern bool support_enqcmd;
522522
extern struct ida idxd_ida;

0 commit comments

Comments
 (0)