Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dmaengine: idxd: make dsa_bus_type const

Since commit d492cc2573a0 ("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 <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Fenghua Yu <fenghua.yu@intel.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240213-bus_cleanup-idxd-v1-1-c3e703675387@marliere.net
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Ricardo B. Marliere and committed by
Vinod Koul
cf497f35 de7d9cb3

+2 -2
+1 -1
drivers/dma/idxd/bus.c
··· 72 72 return add_uevent_var(env, "MODALIAS=" IDXD_DEVICES_MODALIAS_FMT, 0); 73 73 } 74 74 75 - struct bus_type dsa_bus_type = { 75 + const struct bus_type dsa_bus_type = { 76 76 .name = "dsa", 77 77 .match = idxd_config_bus_match, 78 78 .probe = idxd_config_bus_probe,
+1 -1
drivers/dma/idxd/idxd.h
··· 516 516 iowrite32(reg.bits, idxd->reg_base + IDXD_GENCFG_OFFSET); 517 517 } 518 518 519 - extern struct bus_type dsa_bus_type; 519 + extern const struct bus_type dsa_bus_type; 520 520 521 521 extern bool support_enqcmd; 522 522 extern struct ida idxd_ida;