2022-12-22 18:11:11

by Deepak R Varma

[permalink] [raw]
Subject: [PATCH] soc: imx: imx93-src: 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.

Signed-off-by: Deepak R Varma <[email protected]>
---
Note: Proposed change compile tested only using ARM64 defconfig.

drivers/soc/imx/imx93-src.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/soc/imx/imx93-src.c b/drivers/soc/imx/imx93-src.c
index 4d74921cae0f..f1c2e22d5cbd 100644
--- a/drivers/soc/imx/imx93-src.c
+++ b/drivers/soc/imx/imx93-src.c
@@ -21,7 +21,6 @@ MODULE_DEVICE_TABLE(of, imx93_src_ids);
static struct platform_driver imx93_src_driver = {
.driver = {
.name = "imx93_src",
- .owner = THIS_MODULE,
.of_match_table = imx93_src_ids,
},
.probe = imx93_src_probe,
--
2.34.1




2023-01-01 06:53:45

by Shawn Guo

[permalink] [raw]
Subject: Re: [PATCH] soc: imx: imx93-src: No need to set device_driver owner

On Thu, Dec 22, 2022 at 11:27:03PM +0530, Deepak R Varma wrote:
> 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.
>
> Signed-off-by: Deepak R Varma <[email protected]>

Applied, thanks!