2020-10-31 10:17:13

by liuqi (BA)

[permalink] [raw]
Subject: [PATCH] coresight: funnel: Remove unnecessary .owner of static funnel driver

As driver.owner has been set in platform_driver_register(), it is
unnecessary to set it in static funnel driver, so remove it from
struct static_funnel_driver.

Signed-off-by: Qi Liu <[email protected]>
---
drivers/hwtracing/coresight/coresight-funnel.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/hwtracing/coresight/coresight-funnel.c b/drivers/hwtracing/coresight/coresight-funnel.c
index af40814..07bc203 100644
--- a/drivers/hwtracing/coresight/coresight-funnel.c
+++ b/drivers/hwtracing/coresight/coresight-funnel.c
@@ -356,7 +356,6 @@ static struct platform_driver static_funnel_driver = {
.remove = static_funnel_remove,
.driver = {
.name = "coresight-static-funnel",
- .owner = THIS_MODULE,
.of_match_table = static_funnel_match,
.acpi_match_table = ACPI_PTR(static_funnel_ids),
.pm = &funnel_dev_pm_ops,
--
2.8.1


2020-11-02 17:25:26

by Mathieu Poirier

[permalink] [raw]
Subject: Re: [PATCH] coresight: funnel: Remove unnecessary .owner of static funnel driver

Hi Liu,

On Sat, Oct 31, 2020 at 06:12:30PM +0800, Qi Liu wrote:
> As driver.owner has been set in platform_driver_register(), it is
> unnecessary to set it in static funnel driver, so remove it from
> struct static_funnel_driver.
>
> Signed-off-by: Qi Liu <[email protected]>
> ---
> drivers/hwtracing/coresight/coresight-funnel.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-funnel.c b/drivers/hwtracing/coresight/coresight-funnel.c
> index af40814..07bc203 100644
> --- a/drivers/hwtracing/coresight/coresight-funnel.c
> +++ b/drivers/hwtracing/coresight/coresight-funnel.c
> @@ -356,7 +356,6 @@ static struct platform_driver static_funnel_driver = {
> .remove = static_funnel_remove,
> .driver = {
> .name = "coresight-static-funnel",
> - .owner = THIS_MODULE,

I received two identical patches (with a different title) from you. Since there
was no explanation I will discard the first one and work with this one.

You are correct, platform_driver_register() does take care of THIS_MODULE.
Please send another revision where you will do three things:

1) CC the coresight mailing list, as instructed by get_maintainer.pl
1) Also fix the replicator driver.
2) Add a comment that clearly mentions THIS_MODULE doesn't need to be set:

.name = "coresight-static-funnel",
/* THIS_MODULE is taken care of by platform_driver_register() */
.of_match_table = static_funnel_match,
.acpi_match_table = ACPI_PTR(static_funnel_ids),
.pm = &funnel_dev_pm_ops,

Thanks,
Mathieu

> --
> 2.8.1
>

2020-11-03 01:20:25

by liuqi (BA)

[permalink] [raw]
Subject: Re: [PATCH] coresight: funnel: Remove unnecessary .owner of static funnel driver

Hi Mathieu,


On 2020/11/3 1:23, Mathieu Poirier wrote:
> Hi Liu,
>
> On Sat, Oct 31, 2020 at 06:12:30PM +0800, Qi Liu wrote:
>> As driver.owner has been set in platform_driver_register(), it is
>> unnecessary to set it in static funnel driver, so remove it from
>> struct static_funnel_driver.
>>
>> Signed-off-by: Qi Liu <[email protected]>
>> ---
>> drivers/hwtracing/coresight/coresight-funnel.c | 1 -
>> 1 file changed, 1 deletion(-)
>>
>> diff --git a/drivers/hwtracing/coresight/coresight-funnel.c b/drivers/hwtracing/coresight/coresight-funnel.c
>> index af40814..07bc203 100644
>> --- a/drivers/hwtracing/coresight/coresight-funnel.c
>> +++ b/drivers/hwtracing/coresight/coresight-funnel.c
>> @@ -356,7 +356,6 @@ static struct platform_driver static_funnel_driver = {
>> .remove = static_funnel_remove,
>> .driver = {
>> .name = "coresight-static-funnel",
>> - .owner = THIS_MODULE,
> I received two identical patches (with a different title) from you. Since there
> was no explanation I will discard the first one and work with this one.
>
> You are correct, platform_driver_register() does take care of THIS_MODULE.
> Please send another revision where you will do three things:
>
> 1) CC the coresight mailing list, as instructed by get_maintainer.pl
> 1) Also fix the replicator driver.
> 2) Add a comment that clearly mentions THIS_MODULE doesn't need to be set:
>
> .name = "coresight-static-funnel",
> /* THIS_MODULE is taken care of by platform_driver_register() */
> .of_match_table = static_funnel_match,
> .acpi_match_table = ACPI_PTR(static_funnel_ids),
> .pm = &funnel_dev_pm_ops,
>
> Thanks,
> Mathieu
Thanks for your review , I'll send a new patch latter.

Liu
>> --
>> 2.8.1
>>
> .
>