[PATCH] usb: phy: Convert to subsys_platform_driver()

From: Peng Fan (OSS)

Date: Wed Nov 04 2026 - 06:39:51 EST


From: Peng Fan <peng.fan@xxxxxxx>

Replace the open-coded subsys_initcall()/module_exit() platform driver
registration with subsys_platform_driver().

No functional change.

Signed-off-by: Peng Fan <peng.fan@xxxxxxx>
---
drivers/usb/phy/phy-ab8500-usb.c | 13 +------------
drivers/usb/phy/phy-generic.c | 13 +------------
drivers/usb/phy/phy-twl6030-usb.c | 13 +------------
3 files changed, 3 insertions(+), 36 deletions(-)

diff --git a/drivers/usb/phy/phy-ab8500-usb.c b/drivers/usb/phy/phy-ab8500-usb.c
index e2e06e57dced..ad568e7e3d14 100644
--- a/drivers/usb/phy/phy-ab8500-usb.c
+++ b/drivers/usb/phy/phy-ab8500-usb.c
@@ -987,18 +987,7 @@ static struct platform_driver ab8500_usb_driver = {
.name = "abx5x0-usb",
},
};
-
-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");
diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c
index a41671eda2a1..a443ddcddf87 100644
--- a/drivers/usb/phy/phy-generic.c
+++ b/drivers/usb/phy/phy-generic.c
@@ -328,18 +328,7 @@ static struct platform_driver usb_phy_generic_driver = {
.of_match_table = nop_xceiv_dt_ids,
},
};
-
-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");
diff --git a/drivers/usb/phy/phy-twl6030-usb.c b/drivers/usb/phy/phy-twl6030-usb.c
index 8c09db750bfd..a3cdc421ef1d 100644
--- a/drivers/usb/phy/phy-twl6030-usb.c
+++ b/drivers/usb/phy/phy-twl6030-usb.c
@@ -438,18 +438,7 @@ static struct platform_driver twl6030_usb_driver = {
.dev_groups = twl6030_groups,
},
};
-
-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 <hemahk@xxxxxx>");
--
2.51.0