of: Add two stubs for OF_ADDRESS=n and OF=n cases
[PATCH 01/02] of: Add OF_ADDRESS=n stub for of_can_translate_address()
[PATCH 02/02] of: Add OF=n stub for of_find_all_nodes()
This series adds include file stubs for the following functions:
- of_can_translate_address() in of_address.h
- of_find_all_nodes() in of.h
With these stubs in place it is possible to remove Kconfig
dependencies for OF and OF_ADDRESS in certain cases and just
depend on the default behaviour of the stubs.
Signed-off-by: Magnus Damm <[email protected]>
---
Written against renesas git repo at kernel.org using tag
renesas-devel-v3.15-rc8-20140606 which for this code is
the same as v3.15-rc8. Let me know if you want me to rebase.
include/linux/of.h | 5 +++++
include/linux/of_address.h | 5 +++++
2 files changed, 10 insertions(+)
From: Magnus Damm <[email protected]>
Add a stub for the CONFIG_OF_ADDRESS=n case of
of_translate_address(). The return value for the
stub is false which is in sync with when the full
version of the function does not support address
translation. Added to allow removal of Kconfig
dependency handling for CONFIG_OF_ADDRESS.
Signed-off-by: Magnus Damm <[email protected]>
---
include/linux/of_address.h | 5 +++++
1 file changed, 5 insertions(+)
--- 0001/include/linux/of_address.h
+++ work/include/linux/of_address.h 2014-06-06 19:04:44.000000000 +0900
@@ -64,6 +64,11 @@ extern struct of_pci_range *of_pci_range
struct of_pci_range_parser *parser,
struct of_pci_range *range);
#else /* CONFIG_OF_ADDRESS */
+static inline bool of_can_translate_address(struct device_node *dev)
+{
+ return false;
+}
+
static inline struct device_node *of_find_matching_node_by_address(
struct device_node *from,
const struct of_device_id *matches,
From: Magnus Damm <[email protected]>
Add a stub for the CONFIG_OF=n case of of_find_all_nodes().
The return value for the stub is NULL which is in sync with
when the full version of the function cannot find any nodes
registered. Added to allow removal of Kconfig dependency
handling for CONFIG_OF.
Signed-off-by: Magnus Damm <[email protected]>
---
include/linux/of.h | 5 +++++
1 file changed, 5 insertions(+)
--- 0001/include/linux/of.h
+++ work/include/linux/of.h 2014-06-06 19:00:38.000000000 +0900
@@ -349,6 +349,11 @@ int of_device_is_stdout_path(struct devi
#else /* CONFIG_OF */
+static inline struct device_node *of_find_all_nodes(struct device_node *prev)
+{
+ return NULL;
+}
+
static inline const char* of_node_full_name(const struct device_node *np)
{
return "<no-node>";
On Fri, Jun 6, 2014 at 6:59 AM, Magnus Damm <[email protected]> wrote:
> From: Magnus Damm <[email protected]>
>
> Add a stub for the CONFIG_OF_ADDRESS=n case of
> of_translate_address(). The return value for the
> stub is false which is in sync with when the full
> version of the function does not support address
> translation. Added to allow removal of Kconfig
> dependency handling for CONFIG_OF_ADDRESS.
of_can_translate_address is gone in 3.16.
Rob
>
> Signed-off-by: Magnus Damm <[email protected]>
> ---
>
> include/linux/of_address.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
> --- 0001/include/linux/of_address.h
> +++ work/include/linux/of_address.h 2014-06-06 19:04:44.000000000 +0900
> @@ -64,6 +64,11 @@ extern struct of_pci_range *of_pci_range
> struct of_pci_range_parser *parser,
> struct of_pci_range *range);
> #else /* CONFIG_OF_ADDRESS */
> +static inline bool of_can_translate_address(struct device_node *dev)
> +{
> + return false;
> +}
> +
> static inline struct device_node *of_find_matching_node_by_address(
> struct device_node *from,
> const struct of_device_id *matches,