]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
spi: atcspi200: Remove redundant assignment to .owner
authorPei Xiao <xiaopei01@kylinos.cn>
Fri, 20 Feb 2026 02:44:25 +0000 (10:44 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 23 Feb 2026 12:17:57 +0000 (12:17 +0000)
The coccicheck tool reports the following warning for this driver:

./spi-atcspi200.c:670:3-8: No need to set .owner here. The core will do it.

The manual assignment of .owner = THIS_MODULE; in the platform_driver
struct is redundant. The platform_driver_register() function, which is
called to register the driver, is a macro that automatically sets the
driver's owner to THIS_MODULE.

The driver core handles this assignment internally, making the explicit
initialization in the struct definition unnecessary. Remove the
unnecessary line.

Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
Link: https://patch.msgid.link/tencent_65C9C09CBD2B68C400F7145521A4B217E606@qq.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-atcspi200.c

index 60a37ff5c6f55fd501ea22d8ace19b8156d362f4..2075058387f3466fee45e9c41b52f05cb79445ec 100644 (file)
@@ -667,7 +667,6 @@ static struct platform_driver atcspi_driver = {
        .probe = atcspi_probe,
        .driver = {
                .name = "atcspi200",
-               .owner  = THIS_MODULE,
                .of_match_table = atcspi_of_match,
                .pm = pm_sleep_ptr(&atcspi_pm_ops)
        }