nvmem: qcom-spmi-sdam: fix module autoloading
Subsystems (3)
cover nvmem: qcom-spmi-sdam: fix module autoloading
The Qualcomm SDAM nvme driver did not have a module device table, which prevents userspace from autoloading the driver when built as a module.
The driver was also being registered at subsys init time when built in despite the fact that it can also be built as a module, which makes little sense. There are currently no in-tree users of this driver and there's no reason why we can't just let driver core sort out the probe order.
Note that this driver will be used to implement support for the PMIC RTC on Qualcomm platforms where the time registers are read-only (sic).
Johan
Johan Hovold (2):
nvmem: qcom-spmi-sdam: fix module autoloading
nvmem: qcom-spmi-sdam: register at device init time
drivers/nvmem/qcom-spmi-sdam.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-)
Signature · 1 line
2.39.1
PATCH 1/2 nvmem: qcom-spmi-sdam: fix module autoloading
Add the missing module device table so that the driver can be autoloaded when built as a module.
--- drivers/nvmem/qcom-spmi-sdam.c | 1 + 1 file changed, 1 insertion(+)
drivers/nvmem/qcom-spmi-sdam.c +1 -0
@@ -166,6 +166,7 @@ static const struct of_device_id sdam_match_table[] = { { .compatible = "qcom,spmi-sdam" }, {}, }; +MODULE_DEVICE_TABLE (of, sdam_match_table);static struct platform_driver sdam_driver = { .driver = {
Signature · 1 line
2.39.1
PATCH 2/2 nvmem: qcom-spmi-sdam: register at device init time
In reply to Johan HovoldThere are currently no in-tree users of the Qualcomm SDAM nvmem driver and there is generally no point in registering a driver that can be built as a module at subsys init time.
Register the driver at the normal device init time instead and let driver core sort out the probe order.
--- drivers/nvmem/qcom-spmi-sdam.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/nvmem/qcom-spmi-sdam.c +1 -12
@@ -175,18 +175,7 @@ static struct platform_driver sdam_driver = { }, .probe = sdam_probe, }; - -static int __init sdam_init (void ) -{ -return platform_driver_register (&sdam_driver); -} -subsys_initcall (sdam_init); - -static void __exit sdam_exit(void) -{ -return platform_driver_unregister (&sdam_driver); -} -module_exit (sdam_exit); +module_platform_driver (sdam_driver);MODULE_DESCRIPTION ("QCOM SPMI SDAM driver" );MODULE_LICENSE ("GPL v2" );
Signature · 1 line
2.39.1
Quoted 9 lines · Johan Hovold
The Qualcomm SDAM nvme driver did not have a module device table, which prevents userspace from autoloading the driver when built as a module.
The driver was also being registered at subsys init time when built in despite the fact that it can also be built as a module, which makes little sense. There are currently no in-tree users of this driver and there's no reason why we can't just let driver core sort out the probe order.
Quoted 5 lines
Note that this driver will be used to implement support for the PMIC RTC on Qualcomm platforms where the time registers are read-only (sic).
Johan
Quoted 11 lines
Johan Hovold (2):
nvmem: qcom-spmi-sdam: fix module autoloading
nvmem: qcom-spmi-sdam: register at device init timedrivers/nvmem/qcom-spmi-sdam.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-)Signature · 1 line
2.39.1
Quoted 9 lines · Johan Hovold
The Qualcomm SDAM nvme driver did not have a module device table, which prevents userspace from autoloading the driver when built as a module.
The driver was also being registered at subsys init time when built in despite the fact that it can also be built as a module, which makes little sense. There are currently no in-tree users of this driver and there's no reason why we can't just let driver core sort out the probe order.
Quoted 5 lines
Note that this driver will be used to implement support for the PMIC RTC on Qualcomm platforms where the time registers are read-only (sic).
Johan
Applied thanks,
--srin
Quoted 8 lines
Johan Hovold (2):
nvmem: qcom-spmi-sdam: fix module autoloading
nvmem: qcom-spmi-sdam: register at device init timedrivers/nvmem/qcom-spmi-sdam.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-)