Skip to content
Commit ffe6176b authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Michael S. Tsirkin
Browse files

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 9447057e ("platform_device: use a macro instead of
platform_driver_register").

Fixes: 3cfc8838

 ("i2c: virtio: add a virtio i2c frontend driver")
Cc: "Jie Deng" <jie.deng@intel.com>
Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Message-Id: <20240331-module-owner-virtio-v2-1-98f04bfaf46a@linaro.org>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent df9ace76
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment