Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

spi: atcspi200: Remove redundant assignment to .owner

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>

authored by

Pei Xiao and committed by
Mark Brown
fed6e508 6f7e9b11

-1
-1
drivers/spi/spi-atcspi200.c
··· 667 667 .probe = atcspi_probe, 668 668 .driver = { 669 669 .name = "atcspi200", 670 - .owner = THIS_MODULE, 671 670 .of_match_table = atcspi_of_match, 672 671 .pm = pm_sleep_ptr(&atcspi_pm_ops) 673 672 }