826f4378c2fabfb6fa4689786312853ec11d815f
[openwrt/staging/981213.git] /
1 From d119eb38faab61125aaa4f63c74eef61585cf34c Mon Sep 17 00:00:00 2001
2 From: Miquel Raynal <miquel.raynal@bootlin.com>
3 Date: Tue, 4 Apr 2023 18:21:46 +0100
4 Subject: [PATCH] nvmem: layouts: onie-tlv: Use module_nvmem_layout_driver()
5
6 Stop open-coding the module init/exit functions. Use the
7 module_nvmem_layout_driver() instead.
8
9 Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
10 Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
11 Link: https://lore.kernel.org/r/20230404172148.82422-39-srinivas.kandagatla@linaro.org
12 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13 ---
14 drivers/nvmem/layouts/onie-tlv.c | 14 +-------------
15 1 file changed, 1 insertion(+), 13 deletions(-)
16
17 --- a/drivers/nvmem/layouts/onie-tlv.c
18 +++ b/drivers/nvmem/layouts/onie-tlv.c
19 @@ -237,19 +237,7 @@ static struct nvmem_layout onie_tlv_layo
20 .of_match_table = onie_tlv_of_match_table,
21 .add_cells = onie_tlv_parse_table,
22 };
23 -
24 -static int __init onie_tlv_init(void)
25 -{
26 - return nvmem_layout_register(&onie_tlv_layout);
27 -}
28 -
29 -static void __exit onie_tlv_exit(void)
30 -{
31 - nvmem_layout_unregister(&onie_tlv_layout);
32 -}
33 -
34 -module_init(onie_tlv_init);
35 -module_exit(onie_tlv_exit);
36 +module_nvmem_layout_driver(onie_tlv_layout);
37
38 MODULE_LICENSE("GPL");
39 MODULE_AUTHOR("Miquel Raynal <miquel.raynal@bootlin.com>");