Skip to content

Commit 0daf87e

Browse files
rbmarlierejernejsk
authored andcommitted
bus: sunxi-rsb: make sunxi_rsb_bus const
Now that the driver core can properly handle constant struct bus_type, move the sunxi_rsb_bus 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> Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/r/20240204-bus_cleanup-bus-v1-1-bda309c4b829@marliere.net Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
1 parent 6613476 commit 0daf87e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/bus/sunxi-rsb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ struct sunxi_rsb {
128128
};
129129

130130
/* bus / slave device related functions */
131-
static struct bus_type sunxi_rsb_bus;
131+
static const struct bus_type sunxi_rsb_bus;
132132

133133
static int sunxi_rsb_device_match(struct device *dev, struct device_driver *drv)
134134
{
@@ -177,7 +177,7 @@ static int sunxi_rsb_device_modalias(const struct device *dev, struct kobj_ueven
177177
return of_device_uevent_modalias(dev, env);
178178
}
179179

180-
static struct bus_type sunxi_rsb_bus = {
180+
static const struct bus_type sunxi_rsb_bus = {
181181
.name = RSB_CTRL_NAME,
182182
.match = sunxi_rsb_device_match,
183183
.probe = sunxi_rsb_device_probe,

0 commit comments

Comments
 (0)