diff options
author | Ricardo B. Marliere <ricardo@marliere.net> | 2024-02-04 21:52:51 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2024-03-19 07:45:50 +0100 |
commit | 2b666ee29618f452b84aeacf08e1267894de7234 (patch) | |
tree | d6a3ee7662c6de32866bc100524745bd98495866 /drivers/virtio/virtio.c | |
parent | vdpa: make vdpa_bus const (diff) | |
download | linux-2b666ee29618f452b84aeacf08e1267894de7234.tar.xz linux-2b666ee29618f452b84aeacf08e1267894de7234.zip |
virtio: make virtio_bus const
Now that the driver core can properly handle constant struct bus_type,
move the virtio_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>
Message-Id: <20240204-bus_cleanup-virtio-v1-1-3bcb2212aaa0@marliere.net>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to '')
-rw-r--r-- | drivers/virtio/virtio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c index f513ee21b1c1..f173587893cb 100644 --- a/drivers/virtio/virtio.c +++ b/drivers/virtio/virtio.c @@ -353,7 +353,7 @@ static void virtio_dev_remove(struct device *_d) of_node_put(dev->dev.of_node); } -static struct bus_type virtio_bus = { +static const struct bus_type virtio_bus = { .name = "virtio", .match = virtio_dev_match, .dev_groups = virtio_dev_groups, |