Commit 43f60e3f authored by Rafał Miłecki's avatar Rafał Miłecki Committed by Greg Kroah-Hartman

nvmem: drop nvmem_layout_get_match_data()

Thanks for layouts refactoring we now have "struct device" associated
with layout. Also its OF pointer points directly to the "nvmem-layout"
DT node.

All it takes to get match data is a generic of_device_get_match_data().
Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
Reviewed-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: default avatarMichael Walle <michael@walle.cc>
Link: https://lore.kernel.org/r/20231219120104.3422-2-zajec5@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 401df0d4
......@@ -876,19 +876,6 @@ void nvmem_layout_unregister(struct nvmem_layout *layout)
}
EXPORT_SYMBOL_GPL(nvmem_layout_unregister);
const void *nvmem_layout_get_match_data(struct nvmem_device *nvmem,
struct nvmem_layout *layout)
{
struct device_node __maybe_unused *layout_np;
const struct of_device_id *match;
layout_np = of_nvmem_layout_get_container(nvmem);
match = of_match_node(layout->dev.driver->of_match_table, layout_np);
return match ? match->data : NULL;
}
EXPORT_SYMBOL_GPL(nvmem_layout_get_match_data);
/**
* nvmem_register() - Register a nvmem device for given nvmem_config.
* Also creates a binary entry in /sys/bus/nvmem/devices/dev-name/nvmem
......
......@@ -205,9 +205,6 @@ void nvmem_layout_driver_unregister(struct nvmem_layout_driver *drv);
module_driver(__nvmem_layout_driver, nvmem_layout_driver_register, \
nvmem_layout_driver_unregister)
const void *nvmem_layout_get_match_data(struct nvmem_device *nvmem,
struct nvmem_layout *layout);
#else
static inline struct nvmem_device *nvmem_register(const struct nvmem_config *c)
......@@ -238,13 +235,6 @@ static inline int nvmem_layout_register(struct nvmem_layout *layout)
static inline void nvmem_layout_unregister(struct nvmem_layout *layout) {}
static inline const void *
nvmem_layout_get_match_data(struct nvmem_device *nvmem,
struct nvmem_layout *layout)
{
return NULL;
}
#endif /* CONFIG_NVMEM */
#if IS_ENABLED(CONFIG_NVMEM) && IS_ENABLED(CONFIG_OF)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment