public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/02] of: Add two stubs for OF_ADDRESS=n and OF=n cases
@ 2014-06-06 11:59 Magnus Damm
  2014-06-06 11:59 ` [PATCH 01/02] of: Add OF_ADDRESS=n stub for of_can_translate_address() Magnus Damm
  2014-06-06 11:59 ` [PATCH 02/02] of: Add OF=n stub for of_find_all_nodes() Magnus Damm
  0 siblings, 2 replies; 4+ messages in thread
From: Magnus Damm @ 2014-06-06 11:59 UTC (permalink / raw)
  To: linux-kernel; +Cc: grant.likely, Magnus Damm, robh+dt

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 <damm+renesas@opensource.se>
---

 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(+)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 01/02] of: Add OF_ADDRESS=n stub for of_can_translate_address()
  2014-06-06 11:59 [PATCH 00/02] of: Add two stubs for OF_ADDRESS=n and OF=n cases Magnus Damm
@ 2014-06-06 11:59 ` Magnus Damm
  2014-06-06 13:37   ` Rob Herring
  2014-06-06 11:59 ` [PATCH 02/02] of: Add OF=n stub for of_find_all_nodes() Magnus Damm
  1 sibling, 1 reply; 4+ messages in thread
From: Magnus Damm @ 2014-06-06 11:59 UTC (permalink / raw)
  To: linux-kernel; +Cc: grant.likely, Magnus Damm, robh+dt

From: Magnus Damm <damm+renesas@opensource.se>

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 <damm+renesas@opensource.se>
---

 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,

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 02/02] of: Add OF=n stub for of_find_all_nodes()
  2014-06-06 11:59 [PATCH 00/02] of: Add two stubs for OF_ADDRESS=n and OF=n cases Magnus Damm
  2014-06-06 11:59 ` [PATCH 01/02] of: Add OF_ADDRESS=n stub for of_can_translate_address() Magnus Damm
@ 2014-06-06 11:59 ` Magnus Damm
  1 sibling, 0 replies; 4+ messages in thread
From: Magnus Damm @ 2014-06-06 11:59 UTC (permalink / raw)
  To: linux-kernel; +Cc: grant.likely, Magnus Damm, robh+dt

From: Magnus Damm <damm+renesas@opensource.se>

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 <damm+renesas@opensource.se>
---

 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>";

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 01/02] of: Add OF_ADDRESS=n stub for of_can_translate_address()
  2014-06-06 11:59 ` [PATCH 01/02] of: Add OF_ADDRESS=n stub for of_can_translate_address() Magnus Damm
@ 2014-06-06 13:37   ` Rob Herring
  0 siblings, 0 replies; 4+ messages in thread
From: Rob Herring @ 2014-06-06 13:37 UTC (permalink / raw)
  To: Magnus Damm; +Cc: linux-kernel@vger.kernel.org, Grant Likely, Rob Herring

On Fri, Jun 6, 2014 at 6:59 AM, Magnus Damm <magnus.damm@gmail.com> wrote:
> From: Magnus Damm <damm+renesas@opensource.se>
>
> 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 <damm+renesas@opensource.se>
> ---
>
>  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,

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-06-06 13:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-06 11:59 [PATCH 00/02] of: Add two stubs for OF_ADDRESS=n and OF=n cases Magnus Damm
2014-06-06 11:59 ` [PATCH 01/02] of: Add OF_ADDRESS=n stub for of_can_translate_address() Magnus Damm
2014-06-06 13:37   ` Rob Herring
2014-06-06 11:59 ` [PATCH 02/02] of: Add OF=n stub for of_find_all_nodes() Magnus Damm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox