Skip to contentSkip to conversation

usb: phy: convert to subsys_platform_driver()

PATCH New Brian Masney 2 participants 7 messages Nov 7 USB

lore
Share & tools
lore
#0 lore raw

cover usb: phy: convert to subsys_platform_driver()

Reduce boilerplate code in these drivers and convert them over to use the macro subsys_platform_driver().

---
Brian Masney (3):
usb: phy: generic: convert to subsys_platform_driver()
usb: phy: phy-ab8500-usb: convert to subsys_platform_driver()
usb: phy: twl6030: convert to subsys_platform_driver()

 drivers/usb/phy/phy-ab8500-usb.c  | 12 +-----------
 drivers/usb/phy/phy-generic.c     | 12 +-----------
 drivers/usb/phy/phy-twl6030-usb.c | 12 +-----------
 3 files changed, 3 insertions(+), 33 deletions(-)

---
base-commit: ddfe51b0a0f5dc9e415cc2c8ad8db17532dd426b
base-tree: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
change-id: 20261106-usb-subsys-8f41bd9464a8

Best regards,

Signature · 1 line
Brian Masney <[email protected]>
#1 lore raw

PATCH 1/3 usb: phy: generic: convert to subsys_platform_driver()

Reduce boilerplate code in this driver and convert it over to use the macro subsys_platform_driver().

---
 drivers/usb/phy/phy-generic.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/usb/phy/phy-generic.c +1 -11
index a41671eda2a1..68deb7e52b43 100644
@@ -329,17 +329,7 @@ static struct platform_driver usb_phy_generic_driver = {
 	},
 };
 
-static int __init usb_phy_generic_init(void)
-{
-	return platform_driver_register(&usb_phy_generic_driver);
-}
-subsys_initcall(usb_phy_generic_init);
-
-static void __exit usb_phy_generic_exit(void)
-{
-	platform_driver_unregister(&usb_phy_generic_driver);
-}
-module_exit(usb_phy_generic_exit);
+subsys_platform_driver(usb_phy_generic_driver);
 
 MODULE_ALIAS("platform:usb_phy_generic");
 MODULE_AUTHOR("Texas Instruments Inc");
Signature · 1 line
2.56.0
#2 lore raw

Re: [PATCH 1/3] usb: phy: generic: convert to subsys_platform_driver()

Sashiko has reviewed this patch and found no issues.
Quoted 4 lines

Reduce boilerplate code in this driver and convert it over to use the macro subsys_platform_driver().

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#3 lore raw

PATCH 2/3 usb: phy: phy-ab8500-usb: convert to subsys_platform_driver()

In reply to Brian Masney

Reduce boilerplate code in this driver and convert it over to use the macro subsys_platform_driver().

---
 drivers/usb/phy/phy-ab8500-usb.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/usb/phy/phy-ab8500-usb.c +1 -11
index e2e06e57dced..2c569c3244a0 100644
@@ -988,17 +988,7 @@ static struct platform_driver ab8500_usb_driver = {
 	},
 };
 
-static int __init ab8500_usb_init(void)
-{
-	return platform_driver_register(&ab8500_usb_driver);
-}
-subsys_initcall(ab8500_usb_init);
-
-static void __exit ab8500_usb_exit(void)
-{
-	platform_driver_unregister(&ab8500_usb_driver);
-}
-module_exit(ab8500_usb_exit);
+subsys_platform_driver(ab8500_usb_driver);
 
 MODULE_AUTHOR("ST-Ericsson AB");
 MODULE_DESCRIPTION("AB8500 family usb transceiver driver");
Signature · 1 line
2.56.0
#4 lore raw

Re: [PATCH 2/3] usb: phy: phy-ab8500-usb: convert to subsys_platform_driver()

Sashiko has reviewed this patch and found no issues.
Quoted 4 lines

Reduce boilerplate code in this driver and convert it over to use the macro subsys_platform_driver().

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
#5 lore raw

PATCH 3/3 usb: phy: twl6030: convert to subsys_platform_driver()

In reply to Brian Masney

Reduce boilerplate code in this driver and convert it over to use the macro subsys_platform_driver().

---
 drivers/usb/phy/phy-twl6030-usb.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/usb/phy/phy-twl6030-usb.c +1 -11
index 8c09db750bfd..5b71aa95b779 100644
@@ -439,17 +439,7 @@ static struct platform_driver twl6030_usb_driver = {
 	},
 };
 
-static int __init twl6030_usb_init(void)
-{
-	return platform_driver_register(&twl6030_usb_driver);
-}
-subsys_initcall(twl6030_usb_init);
-
-static void __exit twl6030_usb_exit(void)
-{
-	platform_driver_unregister(&twl6030_usb_driver);
-}
-module_exit(twl6030_usb_exit);
+subsys_platform_driver(twl6030_usb_driver);
 
 MODULE_ALIAS("platform:twl6030_usb");
 MODULE_AUTHOR("Hema HK <[email protected]>");
Signature · 1 line
2.56.0
#6 lore raw

Re: [PATCH 3/3] usb: phy: twl6030: convert to subsys_platform_driver()

Sashiko has reviewed this patch and found no issues.
Quoted 4 lines

Reduce boilerplate code in this driver and convert it over to use the macro subsys_platform_driver().

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3