* [PATCH] staging: remove unneeded static set .owner field in platform_driver
@ 2018-09-12 3:40 zhong jiang
2018-09-12 5:59 ` Vaibhav Agarwal
0 siblings, 1 reply; 2+ messages in thread
From: zhong jiang @ 2018-09-12 3:40 UTC (permalink / raw)
To: vaibhav.sr, mgreer, johan, elder, gregkh, matthias.bgg
Cc: linux-kernel, linux-arm-kernel
platform_driver_register will set the .owner field. So it is safe
to remove the redundant assignment.
The issue is detected with the help of Coccinelle.
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
drivers/staging/greybus/audio_codec.c | 1 -
drivers/staging/mt7621-eth/gsw_mt7621.c | 1 -
drivers/staging/mt7621-eth/mtk_eth_soc.c | 1 -
3 files changed, 3 deletions(-)
diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c
index 35acd55..08746c8 100644
--- a/drivers/staging/greybus/audio_codec.c
+++ b/drivers/staging/greybus/audio_codec.c
@@ -1087,7 +1087,6 @@ static int gbaudio_codec_remove(struct platform_device *pdev)
static struct platform_driver gbaudio_codec_driver = {
.driver = {
.name = "apb-dummy-codec",
- .owner = THIS_MODULE,
#ifdef CONFIG_PM
.pm = &gbaudio_codec_pm_ops,
#endif
diff --git a/drivers/staging/mt7621-eth/gsw_mt7621.c b/drivers/staging/mt7621-eth/gsw_mt7621.c
index 2c07b55..53767b1 100644
--- a/drivers/staging/mt7621-eth/gsw_mt7621.c
+++ b/drivers/staging/mt7621-eth/gsw_mt7621.c
@@ -286,7 +286,6 @@ static int mt7621_gsw_remove(struct platform_device *pdev)
.remove = mt7621_gsw_remove,
.driver = {
.name = "mt7621-gsw",
- .owner = THIS_MODULE,
.of_match_table = mediatek_gsw_match,
},
};
diff --git a/drivers/staging/mt7621-eth/mtk_eth_soc.c b/drivers/staging/mt7621-eth/mtk_eth_soc.c
index 7135075..363d3c9 100644
--- a/drivers/staging/mt7621-eth/mtk_eth_soc.c
+++ b/drivers/staging/mt7621-eth/mtk_eth_soc.c
@@ -2167,7 +2167,6 @@ static int mtk_remove(struct platform_device *pdev)
.remove = mtk_remove,
.driver = {
.name = "mtk_soc_eth",
- .owner = THIS_MODULE,
.of_match_table = of_mtk_match,
},
};
--
1.7.12.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: remove unneeded static set .owner field in platform_driver
2018-09-12 3:40 [PATCH] staging: remove unneeded static set .owner field in platform_driver zhong jiang
@ 2018-09-12 5:59 ` Vaibhav Agarwal
0 siblings, 0 replies; 2+ messages in thread
From: Vaibhav Agarwal @ 2018-09-12 5:59 UTC (permalink / raw)
To: zhongjiang
Cc: Mark Greer, Johan Hovold, Alex Elder, Greg Kroah-Hartman,
matthias.bgg, linux-kernel, linux-arm-kernel
On Wed, Sep 12, 2018 at 9:22 AM zhong jiang <zhongjiang@huawei.com> wrote:
>
> platform_driver_register will set the .owner field. So it is safe
> to remove the redundant assignment.
>
> The issue is detected with the help of Coccinelle.
>
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> ---
> drivers/staging/greybus/audio_codec.c | 1 -
> drivers/staging/mt7621-eth/gsw_mt7621.c | 1 -
> drivers/staging/mt7621-eth/mtk_eth_soc.c | 1 -
> 3 files changed, 3 deletions(-)
>
> diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c
> index 35acd55..08746c8 100644
> --- a/drivers/staging/greybus/audio_codec.c
> +++ b/drivers/staging/greybus/audio_codec.c
> @@ -1087,7 +1087,6 @@ static int gbaudio_codec_remove(struct platform_device *pdev)
> static struct platform_driver gbaudio_codec_driver = {
> .driver = {
> .name = "apb-dummy-codec",
> - .owner = THIS_MODULE,
> #ifdef CONFIG_PM
> .pm = &gbaudio_codec_pm_ops,
> #endif
> diff --git a/drivers/staging/mt7621-eth/gsw_mt7621.c b/drivers/staging/mt7621-eth/gsw_mt7621.c
> index 2c07b55..53767b1 100644
> --- a/drivers/staging/mt7621-eth/gsw_mt7621.c
> +++ b/drivers/staging/mt7621-eth/gsw_mt7621.c
> @@ -286,7 +286,6 @@ static int mt7621_gsw_remove(struct platform_device *pdev)
> .remove = mt7621_gsw_remove,
> .driver = {
> .name = "mt7621-gsw",
> - .owner = THIS_MODULE,
> .of_match_table = mediatek_gsw_match,
> },
> };
> diff --git a/drivers/staging/mt7621-eth/mtk_eth_soc.c b/drivers/staging/mt7621-eth/mtk_eth_soc.c
> index 7135075..363d3c9 100644
> --- a/drivers/staging/mt7621-eth/mtk_eth_soc.c
> +++ b/drivers/staging/mt7621-eth/mtk_eth_soc.c
> @@ -2167,7 +2167,6 @@ static int mtk_remove(struct platform_device *pdev)
> .remove = mtk_remove,
> .driver = {
> .name = "mtk_soc_eth",
> - .owner = THIS_MODULE,
> .of_match_table = of_mtk_match,
> },
> };
> --
> 1.7.12.4
>
Acked-by: Vaibhav Agarwal <vaibhav.sr@gmail.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-09-12 5:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-12 3:40 [PATCH] staging: remove unneeded static set .owner field in platform_driver zhong jiang
2018-09-12 5:59 ` Vaibhav Agarwal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).