diff options
author | Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> | 2024-03-31 11:43:48 +0300 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2024-04-08 11:11:04 +0300 |
commit | ffe6176b7f53ca0c99355f13e14a33a40cf49406 (patch) | |
tree | b0bc3625830dae9fbdeb79ca09fea160e9d3a57b /Documentation/driver-api | |
parent | df9ace7647d4123209395bb9967e998d5758c645 (diff) | |
download | linux-ffe6176b7f53ca0c99355f13e14a33a40cf49406.tar.xz |
virtio: store owner from modules with register_virtio_driver()
Modules registering driver with register_virtio_driver() might forget to
set .owner field. i2c-virtio.c for example has it missing. The field
is used by some other kernel parts for reference counting
(try_module_get()), so it is expected that drivers will set it.
Solve the problem by moving this task away from the drivers to the core
virtio code, just like we did for platform_driver in
commit 9447057eaff8 ("platform_device: use a macro instead of
platform_driver_register").
Fixes: 3cfc88380413 ("i2c: virtio: add a virtio i2c frontend driver")
Cc: "Jie Deng" <jie.deng@intel.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Message-Id: <20240331-module-owner-virtio-v2-1-98f04bfaf46a@linaro.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'Documentation/driver-api')
-rw-r--r-- | Documentation/driver-api/virtio/writing_virtio_drivers.rst | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/Documentation/driver-api/virtio/writing_virtio_drivers.rst b/Documentation/driver-api/virtio/writing_virtio_drivers.rst index e14c58796d25..e5de6f5d061a 100644 --- a/Documentation/driver-api/virtio/writing_virtio_drivers.rst +++ b/Documentation/driver-api/virtio/writing_virtio_drivers.rst @@ -97,7 +97,6 @@ like this:: static struct virtio_driver virtio_dummy_driver = { .driver.name = KBUILD_MODNAME, - .driver.owner = THIS_MODULE, .id_table = id_table, .probe = virtio_dummy_probe, .remove = virtio_dummy_remove, |