]> Gentwo Git Trees - linux/.git/commit
USB: serial: set driver owner when registering drivers
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Fri, 3 May 2024 10:10:52 +0000 (12:10 +0200)
committerJohan Hovold <johan@kernel.org>
Mon, 26 Aug 2024 13:28:24 +0000 (15:28 +0200)
commitaf8a6e65f42c6c89414017cc4d78403e83056172
treeebd02a1737f6ec4288a5d94026c63d1a1aee8fc8
parent47ac09b91befbb6a235ab620c32af719f8208399
USB: serial: set driver owner when registering drivers

Modules registering drivers with usb_serial_register_drivers() might
forget to set .owner field.  The field is used by some of 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
USB serial code, just like we did for platform_driver in
commit 9447057eaff8 ("platform_device: use a macro instead of
platform_driver_register").

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
[ johan: amend commit summary ]
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/usb-serial.c
include/linux/usb/serial.h