Skip to contentSkip to conversation

of: add empty of_find_node_by_path() for !OF

PATCH Applied Alexander Shiyan 3 participants 8 messages Apr 16, 2014 Device tree

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 of: add empty of_find_node_by_path() for !OF

Add an empty version of of_find_node_by_path().
This fixes following build error for asoc tree:
sound/soc/fsl/fsl_ssi.c: In function 'fsl_ssi_probe':
sound/soc/fsl/fsl_ssi.c:1471:2: error: implicit declaration of function 'of_find_node_by_path' [-Werror=implicit-function-declaration]
sprop = of_get_property(of_find_node_by_path("/"), "compatible", NULL);

---
 include/linux/of.h | 5 +++++
 1 file changed, 5 insertions(+)
include/linux/of.h +5 -0
index 919bf21..3bad8d1 100644
@@ -374,6 +374,11 @@ static inline struct device_node *of_find_matching_node_and_match(
 	return NULL;
 }
 
+static inline struct device_node *of_find_node_by_path(const char *path)
+{
+	return NULL;
+}
+
 static inline struct device_node *of_get_parent(const struct device_node *node)
 {
 	return NULL;
Signature · 1 line
1.8.3.2
Applied
#1 lore raw
Quoted 8 lines · Alexander Shiyan

Add an empty version of of_find_node_by_path().
This fixes following build error for asoc tree:
sound/soc/fsl/fsl_ssi.c: In function 'fsl_ssi_probe':
sound/soc/fsl/fsl_ssi.c:1471:2: error: implicit declaration of function 'of_find_node_by_path' [-Werror=implicit-function-declaration]
sprop = of_get_property(of_find_node_by_path("/"), "compatible", NULL);

Applied.

Rob

#2 lore raw
Quoted 8 lines · Rob Herring
Quoted 5 lines · Alexander Shiyan

Add an empty version of of_find_node_by_path().
This fixes following build error for asoc tree:
sound/soc/fsl/fsl_ssi.c: In function 'fsl_ssi_probe':
sound/soc/fsl/fsl_ssi.c:1471:2: error: implicit declaration of function 'of_find_node_by_path' [-Werror=implicit-function-declaration]
sprop = of_get_property(of_find_node_by_path("/"), "compatible", NULL);

Quoted 4 lines
Quoted 2 lines

Applied.

Is there a branch I can pull into ASoC, or can I apply it there? This fixes a build failure introduced into there by some recent work.

#3 lore raw
Quoted 9 lines · Mark Brown
Quoted 7 lines · Rob Herring
Quoted 5 lines · Alexander Shiyan

Add an empty version of of_find_node_by_path().
This fixes following build error for asoc tree:
sound/soc/fsl/fsl_ssi.c: In function 'fsl_ssi_probe':
sound/soc/fsl/fsl_ssi.c:1471:2: error: implicit declaration of function 'of_find_node_by_path' [-Werror=implicit-function-declaration]
sprop = of_get_property(of_find_node_by_path("/"), "compatible", NULL);

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Applied.

Is there a branch I can pull into ASoC, or can I apply it there? This fixes a build failure introduced into there by some recent work.

I haven't pushed it out yet. You can take it and add my ack if you want instead. Otherwise, I do plan to send fixes to Linus this week.

Rob

#4 lore raw
Quoted 7 lines · Rob Herring
Quoted 2 lines · Mark Brown

Is there a branch I can pull into ASoC, or can I apply it there? This fixes a build failure introduced into there by some recent work.

I haven't pushed it out yet. You can take it and add my ack if you want instead. Otherwise, I do plan to send fixes to Linus this week.

OK, this is needed for new development so I'll apply it temporarily so I don't break my tree in -next and then discard it once Linus merges - sound sensible?

#5 lore raw
Quoted 6 lines · Mark Brown
Quoted 4 lines · Rob Herring
Quoted 2 lines · Mark Brown

Is there a branch I can pull into ASoC, or can I apply it there? This fixes a build failure introduced into there by some recent work.

Quoted 6 lines
Quoted 2 lines

I haven't pushed it out yet. You can take it and add my ack if you want instead. Otherwise, I do plan to send fixes to Linus this week.

OK, this is needed for new development so I'll apply it temporarily so I don't break my tree in -next and then discard it once Linus merges - sound sensible?

Yes. If this going to be a common pattern, a of_get_machine_compatible() helper might be useful. Usually, any code searching by path makes me suspicious.

Rob

#6 lore raw
Quoted 3 lines · Rob Herring

Yes. If this going to be a common pattern, a of_get_machine_compatible() helper might be useful. Usually, any code searching by path makes me suspicious.

I've always been surprised we don't have more infrastructure for quirking off machine type in a similar way to how ACPI systems use DMI.

#7 lore raw
Quoted 8 lines · Mark Brown
Quoted 3 lines · Rob Herring

Yes. If this going to be a common pattern, a of_get_machine_compatible() helper might be useful. Usually, any code searching by path makes me suspicious.

I've always been surprised we don't have more infrastructure for quirking off machine type in a similar way to how ACPI systems use DMI.

We used to have machine_is_blah which is kind of replaced by of_machine_is_compatible, but yes that is a bit limited. What the fsl ssi driver is doing isn't really a quirk anyway.

PCI also has a whole infrastructure for applying quirks. We could do something similar which could add/fix properties or do various setup. Then we'd be able to scatter calls everywhere:

OF_FIXUP("some-compatible-str", fixup_function);

I don't know that we want to encourge that, but would be a way to separate handling old/broken bindings separately from current code paths. I guess the question is whether we have many existing cases (PPC, I'm looking at you) that would benefit.

BTW, I did propose something similar with conditional initcalls a while back[1]. Perhaps as a fixup would be more acceptable than an initcall.

Rob

[1] http://comments.gmane.org/gmane.linux.drivers.devicetree/50117