Skip to content

Commit b6b9585

Browse files
clementlegerpH5
authored andcommitted
reset: microchip-sparx5: allow building as a module
Set RESET_MCHP_SPARX5 as a tristate and add MODULE_DEVICE_TABLE() to allow building this driver as a module. Signed-off-by: Clément Léger <clement.leger@bootlin.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Link: https://lore.kernel.org/r/20220617103730.490588-1-clement.leger@bootlin.com
1 parent f2906aa commit b6b9585

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

drivers/reset/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ config RESET_LPC18XX
115115
This enables the reset controller driver for NXP LPC18xx/43xx SoCs.
116116

117117
config RESET_MCHP_SPARX5
118-
bool "Microchip Sparx5 reset driver"
118+
tristate "Microchip Sparx5 reset driver"
119119
depends on ARCH_SPARX5 || SOC_LAN966 || COMPILE_TEST
120120
default y if SPARX5_SWITCH
121121
select MFD_SYSCON

drivers/reset/reset-microchip-sparx5.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ static const struct of_device_id mchp_sparx5_reset_of_match[] = {
149149
},
150150
{ }
151151
};
152+
MODULE_DEVICE_TABLE(of, mchp_sparx5_reset_of_match);
152153

153154
static struct platform_driver mchp_sparx5_reset_driver = {
154155
.probe = mchp_sparx5_reset_probe,
@@ -158,12 +159,7 @@ static struct platform_driver mchp_sparx5_reset_driver = {
158159
},
159160
};
160161

161-
static int __init mchp_sparx5_reset_init(void)
162-
{
163-
return platform_driver_register(&mchp_sparx5_reset_driver);
164-
}
165-
166-
postcore_initcall(mchp_sparx5_reset_init);
162+
module_platform_driver(mchp_sparx5_reset_driver);
167163

168164
MODULE_DESCRIPTION("Microchip Sparx5 switch reset driver");
169165
MODULE_AUTHOR("Steen Hegelund <steen.hegelund@microchip.com>");

0 commit comments

Comments
 (0)