netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ptp: Switch back to struct platform_driver::remove()
@ 2024-11-30 14:53 Uwe Kleine-König
  2024-11-30 14:59 ` Richard Cochran
  2024-12-03  0:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 9+ messages in thread
From: Uwe Kleine-König @ 2024-11-30 14:53 UTC (permalink / raw)
  To: Richard Cochran; +Cc: Yangbo Lu, David Woodhouse, netdev, linux-kernel

After commit 0edb555a65d1 ("platform: Make platform_driver::remove()
return void") .remove() is (again) the right callback to implement for
platform drivers.

Convert all platform drivers below drivers/ptp to use .remove(), with
the eventual goal to drop struct platform_driver::remove_new(). As
.remove() and .remove_new() have the same prototypes, conversion is done
by just changing the structure member name in the driver initializer.

While touching these drivers, make the alignment of the touched
initializers consistent.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
Hello,

this is based on Friday's next, feel free to drop changes that result in
a conflict when you come around to apply this. I'll care for the fallout
at a later time then. (Having said that, if you use b4 am -3 and git am
-3, there should be hardly any conflict.)

This is merge window material.

Best regards
Uwe

 drivers/ptp/ptp_clockmatrix.c | 2 +-
 drivers/ptp/ptp_dte.c         | 4 ++--
 drivers/ptp/ptp_fc3.c         | 2 +-
 drivers/ptp/ptp_idt82p33.c    | 2 +-
 drivers/ptp/ptp_ines.c        | 4 ++--
 drivers/ptp/ptp_qoriq.c       | 2 +-
 drivers/ptp/ptp_vmclock.c     | 2 +-
 7 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/ptp/ptp_clockmatrix.c b/drivers/ptp/ptp_clockmatrix.c
index b6f1941308b1..fbb3fa8fc60b 100644
--- a/drivers/ptp/ptp_clockmatrix.c
+++ b/drivers/ptp/ptp_clockmatrix.c
@@ -2471,7 +2471,7 @@ static struct platform_driver idtcm_driver = {
 		.name = "8a3400x-phc",
 	},
 	.probe = idtcm_probe,
-	.remove_new = idtcm_remove,
+	.remove = idtcm_remove,
 };
 
 module_platform_driver(idtcm_driver);
diff --git a/drivers/ptp/ptp_dte.c b/drivers/ptp/ptp_dte.c
index 449ff90927be..372168578a30 100644
--- a/drivers/ptp/ptp_dte.c
+++ b/drivers/ptp/ptp_dte.c
@@ -326,8 +326,8 @@ static struct platform_driver ptp_dte_driver = {
 		.pm = PTP_DTE_PM_OPS,
 		.of_match_table = ptp_dte_of_match,
 	},
-	.probe    = ptp_dte_probe,
-	.remove_new = ptp_dte_remove,
+	.probe = ptp_dte_probe,
+	.remove = ptp_dte_remove,
 };
 module_platform_driver(ptp_dte_driver);
 
diff --git a/drivers/ptp/ptp_fc3.c b/drivers/ptp/ptp_fc3.c
index 879b82f03535..cfced36c70bc 100644
--- a/drivers/ptp/ptp_fc3.c
+++ b/drivers/ptp/ptp_fc3.c
@@ -1003,7 +1003,7 @@ static struct platform_driver idtfc3_driver = {
 		.name = "rc38xxx-phc",
 	},
 	.probe = idtfc3_probe,
-	.remove_new = idtfc3_remove,
+	.remove = idtfc3_remove,
 };
 
 module_platform_driver(idtfc3_driver);
diff --git a/drivers/ptp/ptp_idt82p33.c b/drivers/ptp/ptp_idt82p33.c
index d5732490ed9d..b2fd94d4f863 100644
--- a/drivers/ptp/ptp_idt82p33.c
+++ b/drivers/ptp/ptp_idt82p33.c
@@ -1461,7 +1461,7 @@ static struct platform_driver idt82p33_driver = {
 		.name = "82p33x1x-phc",
 	},
 	.probe = idt82p33_probe,
-	.remove_new = idt82p33_remove,
+	.remove = idt82p33_remove,
 };
 
 module_platform_driver(idt82p33_driver);
diff --git a/drivers/ptp/ptp_ines.c b/drivers/ptp/ptp_ines.c
index 14a23d3a27f2..3d723a2aa6bb 100644
--- a/drivers/ptp/ptp_ines.c
+++ b/drivers/ptp/ptp_ines.c
@@ -781,8 +781,8 @@ static const struct of_device_id ines_ptp_ctrl_of_match[] = {
 MODULE_DEVICE_TABLE(of, ines_ptp_ctrl_of_match);
 
 static struct platform_driver ines_ptp_ctrl_driver = {
-	.probe  = ines_ptp_ctrl_probe,
-	.remove_new = ines_ptp_ctrl_remove,
+	.probe = ines_ptp_ctrl_probe,
+	.remove = ines_ptp_ctrl_remove,
 	.driver = {
 		.name = "ines_ptp_ctrl",
 		.of_match_table = ines_ptp_ctrl_of_match,
diff --git a/drivers/ptp/ptp_qoriq.c b/drivers/ptp/ptp_qoriq.c
index 879cfc1537ac..4d488c1f1941 100644
--- a/drivers/ptp/ptp_qoriq.c
+++ b/drivers/ptp/ptp_qoriq.c
@@ -670,7 +670,7 @@ static struct platform_driver ptp_qoriq_driver = {
 		.of_match_table	= match_table,
 	},
 	.probe       = ptp_qoriq_probe,
-	.remove_new  = ptp_qoriq_remove,
+	.remove      = ptp_qoriq_remove,
 };
 
 module_platform_driver(ptp_qoriq_driver);
diff --git a/drivers/ptp/ptp_vmclock.c b/drivers/ptp/ptp_vmclock.c
index cdca8a3ad1aa..0a2cfc8ad3c5 100644
--- a/drivers/ptp/ptp_vmclock.c
+++ b/drivers/ptp/ptp_vmclock.c
@@ -601,7 +601,7 @@ MODULE_DEVICE_TABLE(acpi, vmclock_acpi_ids);
 
 static struct platform_driver vmclock_platform_driver = {
 	.probe		= vmclock_probe,
-	.remove_new	= vmclock_remove,
+	.remove		= vmclock_remove,
 	.driver	= {
 		.name	= "vmclock",
 		.acpi_match_table = vmclock_acpi_ids,

base-commit: f486c8aa16b8172f63bddc70116a0c897a7f3f02
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] ptp: Switch back to struct platform_driver::remove()
  2024-11-30 14:53 [PATCH] ptp: Switch back to struct platform_driver::remove() Uwe Kleine-König
@ 2024-11-30 14:59 ` Richard Cochran
  2024-11-30 17:34   ` Uwe Kleine-König
  2024-12-03  0:30 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 9+ messages in thread
From: Richard Cochran @ 2024-11-30 14:59 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Yangbo Lu, David Woodhouse, netdev, linux-kernel

On Sat, Nov 30, 2024 at 03:53:49PM +0100, Uwe Kleine-König wrote:
> After commit 0edb555a65d1 ("platform: Make platform_driver::remove()
> return void") .remove() is (again) the right callback to implement for
> platform drivers.
> 
> Convert all platform drivers below drivers/ptp to use .remove(), with
> the eventual goal to drop struct platform_driver::remove_new(). As
> .remove() and .remove_new() have the same prototypes, conversion is done
> by just changing the structure member name in the driver initializer.
> 
> While touching these drivers, make the alignment of the touched
> initializers consistent.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>

Acked-by: Richard Cochran <richardcochran@gmail.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ptp: Switch back to struct platform_driver::remove()
  2024-11-30 14:59 ` Richard Cochran
@ 2024-11-30 17:34   ` Uwe Kleine-König
  2024-11-30 19:01     ` Jakub Kicinski
  0 siblings, 1 reply; 9+ messages in thread
From: Uwe Kleine-König @ 2024-11-30 17:34 UTC (permalink / raw)
  To: Richard Cochran; +Cc: Yangbo Lu, David Woodhouse, netdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1128 bytes --]

Hello Richard,

On Sat, Nov 30, 2024 at 06:59:33AM -0800, Richard Cochran wrote:
> On Sat, Nov 30, 2024 at 03:53:49PM +0100, Uwe Kleine-König wrote:
> > After commit 0edb555a65d1 ("platform: Make platform_driver::remove()
> > return void") .remove() is (again) the right callback to implement for
> > platform drivers.
> > 
> > Convert all platform drivers below drivers/ptp to use .remove(), with
> > the eventual goal to drop struct platform_driver::remove_new(). As
> > .remove() and .remove_new() have the same prototypes, conversion is done
> > by just changing the structure member name in the driver initializer.
> > 
> > While touching these drivers, make the alignment of the touched
> > initializers consistent.
> > 
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> 
> Acked-by: Richard Cochran <richardcochran@gmail.com>

I somehow expected that it's you who will pick up this patch? Does your
ack mean that someone from the netdev people will pick it up (and that I
should have added net-next to the subject prefix and should have waited
until -rc1)?

Best regards
Uwe

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ptp: Switch back to struct platform_driver::remove()
  2024-11-30 17:34   ` Uwe Kleine-König
@ 2024-11-30 19:01     ` Jakub Kicinski
  2024-11-30 21:03       ` Richard Cochran
  0 siblings, 1 reply; 9+ messages in thread
From: Jakub Kicinski @ 2024-11-30 19:01 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Richard Cochran, Yangbo Lu, David Woodhouse, netdev, linux-kernel

On Sat, 30 Nov 2024 18:34:48 +0100 Uwe Kleine-König wrote:
> I somehow expected that it's you who will pick up this patch? Does your
> ack mean that someone from the netdev people will pick it up

Yes, we pick up PTP patches with Richard's ack. I wonder if we should
adjust MAINTAINERS like this:

diff --git a/MAINTAINERS b/MAINTAINERS
index b878ddc99f94..0ae7ac36612e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -16051,6 +16051,7 @@ F:	Documentation/devicetree/bindings/net/
 F:	Documentation/networking/net_cachelines/net_device.rst
 F:	drivers/connector/
 F:	drivers/net/
+F:	drivers/ptp/
 F:	include/dt-bindings/net/
 F:	include/linux/cn_proc.h
 F:	include/linux/etherdevice.h
@@ -18606,13 +18607,12 @@ F:	drivers/hwmon/pt5161l.c
 
 PTP HARDWARE CLOCK SUPPORT
 M:	Richard Cochran <richardcochran@gmail.com>
-L:	netdev@vger.kernel.org
 S:	Maintained
 W:	http://linuxptp.sourceforge.net/
 F:	Documentation/ABI/testing/sysfs-ptp
 F:	Documentation/driver-api/ptp.rst
 F:	drivers/net/phy/dp83640*
-F:	drivers/ptp/*
+F:	drivers/ptp/
 F:	include/linux/ptp_cl*
 K:	(?:\b|_)ptp(?:\b|_)
 

so that get_maintainers --scm can find the right tree?

> (and that I
> should have added net-next to the subject prefix and should have waited
> until -rc1)?

The wait would be nice but we'll live :)
The subject prefix is not a big deal.

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] ptp: Switch back to struct platform_driver::remove()
  2024-11-30 19:01     ` Jakub Kicinski
@ 2024-11-30 21:03       ` Richard Cochran
  0 siblings, 0 replies; 9+ messages in thread
From: Richard Cochran @ 2024-11-30 21:03 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Uwe Kleine-König, Yangbo Lu, David Woodhouse, netdev,
	linux-kernel

On Sat, Nov 30, 2024 at 11:01:44AM -0800, Jakub Kicinski wrote:
> Yes, we pick up PTP patches with Richard's ack. I wonder if we should
> adjust MAINTAINERS like this:
...
> so that get_maintainers --scm can find the right tree?

Sounds good to me.

Thanks,
Richard

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ptp: Switch back to struct platform_driver::remove()
  2024-11-30 14:53 [PATCH] ptp: Switch back to struct platform_driver::remove() Uwe Kleine-König
  2024-11-30 14:59 ` Richard Cochran
@ 2024-12-03  0:30 ` patchwork-bot+netdevbpf
  2024-12-03  9:48   ` Geert Uytterhoeven
  1 sibling, 1 reply; 9+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-12-03  0:30 UTC (permalink / raw)
  To: =?utf-8?q?Uwe_Kleine-K=C3=B6nig_=3Cu=2Ekleine-koenig=40baylibre=2Ecom=3E?=
  Cc: richardcochran, yangbo.lu, dwmw2, netdev, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Sat, 30 Nov 2024 15:53:49 +0100 you wrote:
> After commit 0edb555a65d1 ("platform: Make platform_driver::remove()
> return void") .remove() is (again) the right callback to implement for
> platform drivers.
> 
> Convert all platform drivers below drivers/ptp to use .remove(), with
> the eventual goal to drop struct platform_driver::remove_new(). As
> .remove() and .remove_new() have the same prototypes, conversion is done
> by just changing the structure member name in the driver initializer.
> 
> [...]

Here is the summary with links:
  - ptp: Switch back to struct platform_driver::remove()
    https://git.kernel.org/netdev/net-next/c/b32913a5609a

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ptp: Switch back to struct platform_driver::remove()
  2024-12-03  0:30 ` patchwork-bot+netdevbpf
@ 2024-12-03  9:48   ` Geert Uytterhoeven
  2024-12-03 11:49     ` Uwe Kleine-König
  0 siblings, 1 reply; 9+ messages in thread
From: Geert Uytterhoeven @ 2024-12-03  9:48 UTC (permalink / raw)
  To: Uwe Kleine-König, Jakub Kicinski
  Cc: richardcochran, yangbo.lu, dwmw2, Linus Torvalds, netdev,
	linux-kernel, Linux-Next

On Tue, Dec 3, 2024 at 1:30 AM <patchwork-bot+netdevbpf@kernel.org> wrote:
> This patch was applied to netdev/net-next.git (main)
> by Jakub Kicinski <kuba@kernel.org>:
>
> On Sat, 30 Nov 2024 15:53:49 +0100 you wrote:
> > After commit 0edb555a65d1 ("platform: Make platform_driver::remove()
> > return void") .remove() is (again) the right callback to implement for
> > platform drivers.
> >
> > Convert all platform drivers below drivers/ptp to use .remove(), with
> > the eventual goal to drop struct platform_driver::remove_new(). As
> > .remove() and .remove_new() have the same prototypes, conversion is done
> > by just changing the structure member name in the driver initializer.
> >
> > [...]
>
> Here is the summary with links:
>   - ptp: Switch back to struct platform_driver::remove()
>     https://git.kernel.org/netdev/net-next/c/b32913a5609a

Note that this now conflicts with commit e70140ba0d2b1a30 ("Get rid of
'remove_new' relic from platform driver struct") upstream.
Resolution: just take the version from upstream.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ptp: Switch back to struct platform_driver::remove()
  2024-12-03  9:48   ` Geert Uytterhoeven
@ 2024-12-03 11:49     ` Uwe Kleine-König
  2024-12-04  1:19       ` Jakub Kicinski
  0 siblings, 1 reply; 9+ messages in thread
From: Uwe Kleine-König @ 2024-12-03 11:49 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Jakub Kicinski, richardcochran, yangbo.lu, dwmw2, Linus Torvalds,
	netdev, linux-kernel, Linux-Next

[-- Attachment #1: Type: text/plain, Size: 1725 bytes --]

Hello Geert,

thanks for pointing out this conflict.

On Tue, Dec 03, 2024 at 10:48:36AM +0100, Geert Uytterhoeven wrote:
> On Tue, Dec 3, 2024 at 1:30 AM <patchwork-bot+netdevbpf@kernel.org> wrote:
> > This patch was applied to netdev/net-next.git (main)
> > by Jakub Kicinski <kuba@kernel.org>:
> >
> > On Sat, 30 Nov 2024 15:53:49 +0100 you wrote:
> > > After commit 0edb555a65d1 ("platform: Make platform_driver::remove()
> > > return void") .remove() is (again) the right callback to implement for
> > > platform drivers.
> > >
> > > Convert all platform drivers below drivers/ptp to use .remove(), with
> > > the eventual goal to drop struct platform_driver::remove_new(). As
> > > .remove() and .remove_new() have the same prototypes, conversion is done
> > > by just changing the structure member name in the driver initializer.
> > >
> > > [...]
> >
> > Here is the summary with links:
> >   - ptp: Switch back to struct platform_driver::remove()
> >     https://git.kernel.org/netdev/net-next/c/b32913a5609a
> 
> Note that this now conflicts with commit e70140ba0d2b1a30 ("Get rid of
> 'remove_new' relic from platform driver struct") upstream.

Indeed. The differences are only about whitespace.

> Resolution: just take the version from upstream.

But IMHO my variant is better than Linus's. After Linus' change the =
for .probe and .remove are aligned in the conflicting files. However the
other members initialized there are only using a single space before the
=. My change used the single space variant consistently for the whole
initializer.

So I suggest to either drop my change, or in the conflict resolution
take my variant and not Linus's.

Best regards
Uwe

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ptp: Switch back to struct platform_driver::remove()
  2024-12-03 11:49     ` Uwe Kleine-König
@ 2024-12-04  1:19       ` Jakub Kicinski
  0 siblings, 0 replies; 9+ messages in thread
From: Jakub Kicinski @ 2024-12-04  1:19 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Geert Uytterhoeven, richardcochran, yangbo.lu, dwmw2,
	Linus Torvalds, netdev, linux-kernel, Linux-Next

On Tue, 3 Dec 2024 12:49:54 +0100 Uwe Kleine-König wrote:
> > Resolution: just take the version from upstream.  
> 
> But IMHO my variant is better than Linus's. After Linus' change the =
> for .probe and .remove are aligned in the conflicting files. However the
> other members initialized there are only using a single space before the
> =. My change used the single space variant consistently for the whole
> initializer.
> 
> So I suggest to either drop my change, or in the conflict resolution
> take my variant and not Linus's.

I'll revert, it's less work.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-12-04  1:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-30 14:53 [PATCH] ptp: Switch back to struct platform_driver::remove() Uwe Kleine-König
2024-11-30 14:59 ` Richard Cochran
2024-11-30 17:34   ` Uwe Kleine-König
2024-11-30 19:01     ` Jakub Kicinski
2024-11-30 21:03       ` Richard Cochran
2024-12-03  0:30 ` patchwork-bot+netdevbpf
2024-12-03  9:48   ` Geert Uytterhoeven
2024-12-03 11:49     ` Uwe Kleine-König
2024-12-04  1:19       ` Jakub Kicinski

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).