Skip to contentSkip to conversation

gpu: drm: bridge: No need to set device_driver owner

PATCH Applied Anup Sharma 2 participants 3 messages May 13, 2023 – May 16, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpu: drm: bridge: No need to set device_driver owner

There is no need to exclusively set the .owner member of the struct device_driver when defining the platform_driver struct. The Linux core takes care of setting the .owner member as part of the call to module_platform_driver() helper function.

Issue identified using the platform_no_drv_owner.cocci Coccinelle semantic patch as:
drivers/gpu/drm/bridge/samsung-dsim.c:1957:6-11: No need to set .owner here. The core will do it.

No functional changes are intended.

---
 drivers/gpu/drm/bridge/samsung-dsim.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/bridge/samsung-dsim.c +0 -1
index e0a402a85787..10dc3315e69e 100644
@@ -1954,7 +1954,6 @@ static struct platform_driver samsung_dsim_driver = {
 	.remove = samsung_dsim_remove,
 	.driver = {
 		   .name = "samsung-dsim",
-		   .owner = THIS_MODULE,
 		   .pm = &samsung_dsim_pm_ops,
 		   .of_match_table = samsung_dsim_of_match,
 	},
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 22 lines · Anup Sharma

There is no need to exclusively set the .owner member of the struct device_driver when defining the platform_driver struct. The Linux core takes care of setting the .owner member as part of the call to module_platform_driver() helper function.

Issue identified using the platform_no_drv_owner.cocci Coccinelle semantic patch as:
drivers/gpu/drm/bridge/samsung-dsim.c:1957:6-11: No need to set .owner here. The core will do it.

No functional changes are intended.

---
  drivers/gpu/drm/bridge/samsung-dsim.c | 1 -
  1 file changed, 1 deletion(-)
drivers/gpu/drm/bridge/samsung-dsim.c +0 -0
index e0a402a85787..10dc3315e69e 100644

drivers/gpu/drm/bridge/samsung-dsim.c static struct platform_driver samsung_dsim_driver = { · line 1959

Quoted 7 lines
drivers/gpu/drm/bridge/samsung-dsim.c +0 -1
@@ -1954,7 +1954,6 @@ static struct platform_driver samsung_dsim_driver = {
  	.remove = samsung_dsim_remove,
  	.driver = {
  		   .name = "samsung-dsim",
-		   .owner = THIS_MODULE,
  		   .pm = &samsung_dsim_pm_ops,
  		   .of_match_table = samsung_dsim_of_match,
  	},
maintainer Applied
#2 lore raw
In reply to Anup Sharma

Hi,

Quoted 11 lines · Anup Sharma

There is no need to exclusively set the .owner member of the struct device_driver when defining the platform_driver struct. The Linux core takes care of setting the .owner member as part of the call to module_platform_driver() helper function.

Issue identified using the platform_no_drv_owner.cocci Coccinelle semantic patch as:
drivers/gpu/drm/bridge/samsung-dsim.c:1957:6-11: No need to set .owner here. The core will do it.

[...]

Thanks, Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-next)

[1/1] gpu: drm: bridge: No need to set device_driver owner

      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=728cb3f061e2b3a002fd76d91c2449b1497b6640
Signature · 1 line
Neil