2016-04-27 11:11:46

by Heikki Krogerus

[permalink] [raw]
Subject: [PATCH] of: Add stub for of_get_next_parent()

Fixes a compiler error:

drivers/phy/phy-core.c: In function ‘__of_phy_provider_register’:
drivers/phy/phy-core.c:848:13: error: implicit declaration of function
‘of_get_next_parent’ [-Werror=implicit-function-declaration]
parent = of_get_next_parent(parent);
^

Fixes: 2f7600bc981c ("phy: core: Allow children node to be overridden")
Signed-off-by: Heikki Krogerus <[email protected]>
---
include/linux/of.h | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/include/linux/of.h b/include/linux/of.h
index c7292e8..00ab231 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -468,6 +468,12 @@ static inline struct device_node *of_get_parent(const struct device_node *node)
return NULL;
}

+static inline struct device_node *of_get_next_parent(
+ const struct device_node *node)
+{
+ return NULL;
+}
+
static inline struct device_node *of_get_next_child(
const struct device_node *node, struct device_node *prev)
{
--
2.8.0.rc3


2016-04-27 11:13:58

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH] of: Add stub for of_get_next_parent()

On Wednesday 27 April 2016 14:11:40 Heikki Krogerus wrote:
> Fixes a compiler error:
>
> drivers/phy/phy-core.c: In function ‘__of_phy_provider_register’:
> drivers/phy/phy-core.c:848:13: error: implicit declaration of function
> ‘of_get_next_parent’ [-Werror=implicit-function-declaration]
> parent = of_get_next_parent(parent);
> ^
>
> Fixes: 2f7600bc981c ("phy: core: Allow children node to be overridden")
> Signed-off-by: Heikki Krogerus <[email protected]>

Yes, this works. I have submitted an alternative patch to fix the
build error, changing the PHY core to not use any of the OF interfaces
if CONFIG_OF is disabled.

We can also have both.

Acked-by: Arnd Bergmann <[email protected]>

2016-04-27 15:00:53

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH] of: Add stub for of_get_next_parent()

On Wed, Apr 27, 2016 at 01:13:33PM +0200, Arnd Bergmann wrote:
> On Wednesday 27 April 2016 14:11:40 Heikki Krogerus wrote:
> > Fixes a compiler error:
> >
> > drivers/phy/phy-core.c: In function ‘__of_phy_provider_register’:
> > drivers/phy/phy-core.c:848:13: error: implicit declaration of function
> > ‘of_get_next_parent’ [-Werror=implicit-function-declaration]
> > parent = of_get_next_parent(parent);
> > ^
> >
> > Fixes: 2f7600bc981c ("phy: core: Allow children node to be overridden")
> > Signed-off-by: Heikki Krogerus <[email protected]>
>
> Yes, this works. I have submitted an alternative patch to fix the
> build error, changing the PHY core to not use any of the OF interfaces
> if CONFIG_OF is disabled.
>
> We can also have both.
>
> Acked-by: Arnd Bergmann <[email protected]>

I'm thinking of simply open-coding this for now, to avoid the use of
of_get_next_parent(). This is part of a set of patches that has gone
through countless revisions over the past two years and the timing
is such that adding yet another dependency will likely make it miss
the next cycle again. I'd really like to avoid that.

If nobody objects I'll volunteer to refactor this after v4.7-rc1.

Alternatively, perhaps Rob can give a very quick Acked-by on the
of_get_next_parent() addition, then I might still have time to take
this through one or two linux-next releases before sending out the
pull requests around the end of the week.

Thierry


Attachments:
(No filename) (1.45 kB)
signature.asc (819.00 B)
Download all attachments