nvmem: Move of_nvmem_layout_get_container() in another header
nvmem-consumer.h is included by consumer devices, extracting data from NVMEM devices whereas nvmem-provider.h is included by devices providing NVMEM content. The only users of of_nvmem_layout_get_container() outside of the core are layout drivers, so better move its prototype to nvmem-provider.h. While we do so, we also move the kdoc associated with the function to the header rather than the .c file. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20231215111536.316972-3-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
7f38b70042
commit
4a1a40233b
@ -847,14 +847,6 @@ static int nvmem_add_cells_from_layout(struct nvmem_device *nvmem)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_OF)
|
#if IS_ENABLED(CONFIG_OF)
|
||||||
/**
|
|
||||||
* of_nvmem_layout_get_container() - Get OF node to layout container.
|
|
||||||
*
|
|
||||||
* @nvmem: nvmem device.
|
|
||||||
*
|
|
||||||
* Return: a node pointer with refcount incremented or NULL if no
|
|
||||||
* container exists. Use of_node_put() on it when done.
|
|
||||||
*/
|
|
||||||
struct device_node *of_nvmem_layout_get_container(struct nvmem_device *nvmem)
|
struct device_node *of_nvmem_layout_get_container(struct nvmem_device *nvmem)
|
||||||
{
|
{
|
||||||
return of_get_child_by_name(nvmem->dev.of_node, "nvmem-layout");
|
return of_get_child_by_name(nvmem->dev.of_node, "nvmem-layout");
|
||||||
|
@ -247,7 +247,6 @@ struct nvmem_cell *of_nvmem_cell_get(struct device_node *np,
|
|||||||
const char *id);
|
const char *id);
|
||||||
struct nvmem_device *of_nvmem_device_get(struct device_node *np,
|
struct nvmem_device *of_nvmem_device_get(struct device_node *np,
|
||||||
const char *name);
|
const char *name);
|
||||||
struct device_node *of_nvmem_layout_get_container(struct nvmem_device *nvmem);
|
|
||||||
#else
|
#else
|
||||||
static inline struct nvmem_cell *of_nvmem_cell_get(struct device_node *np,
|
static inline struct nvmem_cell *of_nvmem_cell_get(struct device_node *np,
|
||||||
const char *id)
|
const char *id)
|
||||||
@ -260,12 +259,6 @@ static inline struct nvmem_device *of_nvmem_device_get(struct device_node *np,
|
|||||||
{
|
{
|
||||||
return ERR_PTR(-EOPNOTSUPP);
|
return ERR_PTR(-EOPNOTSUPP);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline struct device_node *
|
|
||||||
of_nvmem_layout_get_container(struct nvmem_device *nvmem)
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
#endif /* CONFIG_NVMEM && CONFIG_OF */
|
#endif /* CONFIG_NVMEM && CONFIG_OF */
|
||||||
|
|
||||||
#endif /* ifndef _LINUX_NVMEM_CONSUMER_H */
|
#endif /* ifndef _LINUX_NVMEM_CONSUMER_H */
|
||||||
|
@ -244,6 +244,27 @@ nvmem_layout_get_match_data(struct nvmem_device *nvmem,
|
|||||||
|
|
||||||
#endif /* CONFIG_NVMEM */
|
#endif /* CONFIG_NVMEM */
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_NVMEM) && IS_ENABLED(CONFIG_OF)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* of_nvmem_layout_get_container() - Get OF node of layout container
|
||||||
|
*
|
||||||
|
* @nvmem: nvmem device
|
||||||
|
*
|
||||||
|
* Return: a node pointer with refcount incremented or NULL if no
|
||||||
|
* container exists. Use of_node_put() on it when done.
|
||||||
|
*/
|
||||||
|
struct device_node *of_nvmem_layout_get_container(struct nvmem_device *nvmem);
|
||||||
|
|
||||||
|
#else /* CONFIG_NVMEM && CONFIG_OF */
|
||||||
|
|
||||||
|
static inline struct device_node *of_nvmem_layout_get_container(struct nvmem_device *nvmem)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* CONFIG_NVMEM && CONFIG_OF */
|
||||||
|
|
||||||
#define module_nvmem_layout_driver(__layout_driver) \
|
#define module_nvmem_layout_driver(__layout_driver) \
|
||||||
module_driver(__layout_driver, nvmem_layout_register, \
|
module_driver(__layout_driver, nvmem_layout_register, \
|
||||||
nvmem_layout_unregister)
|
nvmem_layout_unregister)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user