mtd: fix build with GCC 14
[openwrt/openwrt.git] / target / linux / generic / backport-6.1 / 809-v6.3-0010-nvmem-qcom-spmi-sdam-register-at-device-init-time.patch
1 From eb7dda20f42a9137e9ee53d5ed3b743d49338cb5 Mon Sep 17 00:00:00 2001
2 From: Johan Hovold <johan+linaro@kernel.org>
3 Date: Mon, 6 Feb 2023 13:43:54 +0000
4 Subject: [PATCH] nvmem: qcom-spmi-sdam: register at device init time
5
6 There are currently no in-tree users of the Qualcomm SDAM nvmem driver
7 and there is generally no point in registering a driver that can be
8 built as a module at subsys init time.
9
10 Register the driver at the normal device init time instead and let
11 driver core sort out the probe order.
12
13 Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
14 Reviewed-by: Bjorn Andersson <andersson@kernel.org>
15 Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
16 Link: https://lore.kernel.org/r/20230206134356.839737-21-srinivas.kandagatla@linaro.org
17 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
18 ---
19 drivers/nvmem/qcom-spmi-sdam.c | 13 +------------
20 1 file changed, 1 insertion(+), 12 deletions(-)
21
22 --- a/drivers/nvmem/qcom-spmi-sdam.c
23 +++ b/drivers/nvmem/qcom-spmi-sdam.c
24 @@ -175,18 +175,7 @@ static struct platform_driver sdam_drive
25 },
26 .probe = sdam_probe,
27 };
28 -
29 -static int __init sdam_init(void)
30 -{
31 - return platform_driver_register(&sdam_driver);
32 -}
33 -subsys_initcall(sdam_init);
34 -
35 -static void __exit sdam_exit(void)
36 -{
37 - return platform_driver_unregister(&sdam_driver);
38 -}
39 -module_exit(sdam_exit);
40 +module_platform_driver(sdam_driver);
41
42 MODULE_DESCRIPTION("QCOM SPMI SDAM driver");
43 MODULE_LICENSE("GPL v2");