Skip to contentSkip to conversation

ptp: Switch back to struct platform_driver::remove()

PATCH Applied Uwe Kleine-König 5 participants 9 messages Nov 30, 2024 – Dec 4, 2024

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

PATCH 1/1 ptp: Switch back to struct platform_driver::remove()

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.

---
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(-)
drivers/ptp/ptp_clockmatrix.c +1 -1
index b6f1941308b1..fbb3fa8fc60b 100644
@@ -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);
drivers/ptp/ptp_dte.c +2 -2
index 449ff90927be..372168578a30 100644
@@ -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);
 
drivers/ptp/ptp_fc3.c +1 -1
index 879b82f03535..cfced36c70bc 100644
@@ -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);
drivers/ptp/ptp_idt82p33.c +1 -1
index d5732490ed9d..b2fd94d4f863 100644
@@ -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);
drivers/ptp/ptp_ines.c +2 -2
index 14a23d3a27f2..3d723a2aa6bb 100644
@@ -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,
drivers/ptp/ptp_qoriq.c +1 -1
index 879cfc1537ac..4d488c1f1941 100644
@@ -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);
drivers/ptp/ptp_vmclock.c +1 -1
index cdca8a3ad1aa..0a2cfc8ad3c5 100644
@@ -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

Signature · 1 line
2.45.2
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Uwe Kleine-König

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.

Quoted 4 lines

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

#2 lore raw

Hello Richard,

Quoted 10 lines · Richard Cochran
Quoted 9 lines · Uwe Kleine-König

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.

Quoted 6 lines
Quoted 4 lines

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

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

maintainer
#3 lore raw
Quoted 2 lines · 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:

MAINTAINERS +2 -2
index b878ddc99f94..0ae7ac36612e 100644
@@ -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 <[email protected]>
-L:	[email protected]
 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?

Quoted 3 lines

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

maintainer
#4 lore raw
Quoted 2 lines · Jakub Kicinski

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

...

Quoted 1 line

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

Sounds good to me.

Thanks,
Richard

#5 lore raw
In reply to Uwe Kleine-König
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 10 lines · 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!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
#6 lore raw
Quoted 13 lines · On Tue, Dec 3, 2024 at 1:30 AM <[email protected]> wrote:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · 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.

Quoted 5 lines
Quoted 1 line

[...]

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

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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
#7 lore raw

Hello Geert,

thanks for pointing out this conflict.

Quoted 14 lines · Geert Uytterhoeven
Quoted 13 lines · On Tue, Dec 3, 2024 at 1:30 AM <[email protected]> wrote:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · 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.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

[...]

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.

Quoted 1 line

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

maintainer
#8 lore raw
Quoted 10 lines · On Tue, 3 Dec 2024 12:49:54 +0100 Uwe Kleine-König wrote:
Quoted 1 line

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.