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

sh: dma-sysfs: Make dma_subsys const

Now that the driver core can properly handle constant struct bus_type,
move the dma_subsys 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: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Link: https://lore.kernel.org/r/20240204-bus_cleanup-sh-v1-1-44ced951bb16@marliere.net
Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>

authored by

Ricardo B. Marliere and committed by
John Paul Adrian Glaubitz
d32b8d7e 6613476e

+1 -1
+1 -1
arch/sh/drivers/dma/dma-sysfs.c
··· 15 15 #include <linux/string.h> 16 16 #include <asm/dma.h> 17 17 18 - static struct bus_type dma_subsys = { 18 + static const struct bus_type dma_subsys = { 19 19 .name = "dma", 20 20 .dev_name = "dma", 21 21 };