ath79: add support for Huawei AP5030DN
[openwrt/openwrt.git] / target / linux / generic / backport-6.1 / 819-v6.8-0009-nvmem-drop-nvmem_layout_get_match_data.patch
1 From 43f60e3fb62edc7bd8891de8779fb422f4ae23ae Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
3 Date: Tue, 19 Dec 2023 13:01:04 +0100
4 Subject: [PATCH] nvmem: drop nvmem_layout_get_match_data()
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Thanks for layouts refactoring we now have "struct device" associated
10 with layout. Also its OF pointer points directly to the "nvmem-layout"
11 DT node.
12
13 All it takes to get match data is a generic of_device_get_match_data().
14
15 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
16 Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
17 Reviewed-by: Michael Walle <michael@walle.cc>
18 Link: https://lore.kernel.org/r/20231219120104.3422-2-zajec5@gmail.com
19 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20 ---
21 drivers/nvmem/core.c | 13 -------------
22 include/linux/nvmem-provider.h | 10 ----------
23 2 files changed, 23 deletions(-)
24
25 --- a/drivers/nvmem/core.c
26 +++ b/drivers/nvmem/core.c
27 @@ -877,19 +877,6 @@ void nvmem_layout_unregister(struct nvme
28 }
29 EXPORT_SYMBOL_GPL(nvmem_layout_unregister);
30
31 -const void *nvmem_layout_get_match_data(struct nvmem_device *nvmem,
32 - struct nvmem_layout *layout)
33 -{
34 - struct device_node __maybe_unused *layout_np;
35 - const struct of_device_id *match;
36 -
37 - layout_np = of_nvmem_layout_get_container(nvmem);
38 - match = of_match_node(layout->dev.driver->of_match_table, layout_np);
39 -
40 - return match ? match->data : NULL;
41 -}
42 -EXPORT_SYMBOL_GPL(nvmem_layout_get_match_data);
43 -
44 /**
45 * nvmem_register() - Register a nvmem device for given nvmem_config.
46 * Also creates a binary entry in /sys/bus/nvmem/devices/dev-name/nvmem
47 --- a/include/linux/nvmem-provider.h
48 +++ b/include/linux/nvmem-provider.h
49 @@ -205,9 +205,6 @@ void nvmem_layout_driver_unregister(stru
50 module_driver(__nvmem_layout_driver, nvmem_layout_driver_register, \
51 nvmem_layout_driver_unregister)
52
53 -const void *nvmem_layout_get_match_data(struct nvmem_device *nvmem,
54 - struct nvmem_layout *layout);
55 -
56 #else
57
58 static inline struct nvmem_device *nvmem_register(const struct nvmem_config *c)
59 @@ -238,13 +235,6 @@ static inline int nvmem_layout_register(
60
61 static inline void nvmem_layout_unregister(struct nvmem_layout *layout) {}
62
63 -static inline const void *
64 -nvmem_layout_get_match_data(struct nvmem_device *nvmem,
65 - struct nvmem_layout *layout)
66 -{
67 - return NULL;
68 -}
69 -
70 #endif /* CONFIG_NVMEM */
71
72 #if IS_ENABLED(CONFIG_NVMEM) && IS_ENABLED(CONFIG_OF)