2023-01-26 13:32:40

by Johan Hovold

[permalink] [raw]
Subject: [PATCH 0/2] 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(-)

--
2.39.1



2023-01-26 13:32:45

by Johan Hovold

[permalink] [raw]
Subject: [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.

Fixes: 40ce9798794f ("nvmem: add QTI SDAM driver")
Cc: [email protected] # 5.6
Signed-off-by: Johan Hovold <[email protected]>
---
drivers/nvmem/qcom-spmi-sdam.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/nvmem/qcom-spmi-sdam.c b/drivers/nvmem/qcom-spmi-sdam.c
index 4fcb63507ecd..8499892044b7 100644
--- a/drivers/nvmem/qcom-spmi-sdam.c
+++ b/drivers/nvmem/qcom-spmi-sdam.c
@@ -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 = {
--
2.39.1


2023-01-26 16:10:16

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH 0/2] nvmem: qcom-spmi-sdam: fix module autoloading

On Thu, Jan 26, 2023 at 02:30:32PM +0100, Johan Hovold wrote:
> 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
>

Reviewed-by: Bjorn Andersson <[email protected]>

>
> 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(-)
>
> --
> 2.39.1
>

2023-01-27 09:31:04

by Srinivas Kandagatla

[permalink] [raw]
Subject: Re: [PATCH 0/2] nvmem: qcom-spmi-sdam: fix module autoloading



On 26/01/2023 13:30, Johan Hovold wrote:
> 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
>


Applied thanks,

--srin

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