All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] of: add empty of_find_node_by_path() for !OF
@ 2014-04-16  6:49 Alexander Shiyan
  2014-04-16 12:26 ` Rob Herring
  0 siblings, 1 reply; 8+ messages in thread
From: Alexander Shiyan @ 2014-04-16  6:49 UTC (permalink / raw)
  To: alsa-devel
  Cc: Stephen Rothwell, Alexander Shiyan, Liam Girdwood, Takashi Iwai,
	Timur Tabi, Rob Herring, Mark Brown, Grant Likely

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

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 include/linux/of.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/linux/of.h b/include/linux/of.h
index 919bf21..3bad8d1 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -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;
-- 
1.8.3.2

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

* Re: [PATCH] of: add empty of_find_node_by_path() for !OF
  2014-04-16  6:49 [PATCH] of: add empty of_find_node_by_path() for !OF Alexander Shiyan
@ 2014-04-16 12:26 ` Rob Herring
  2014-04-16 14:25   ` Mark Brown
  0 siblings, 1 reply; 8+ messages in thread
From: Rob Herring @ 2014-04-16 12:26 UTC (permalink / raw)
  To: Alexander Shiyan
  Cc: Stephen Rothwell, Linux-ALSA, Liam Girdwood, Takashi Iwai,
	Timur Tabi, Rob Herring, Mark Brown, Grant Likely

On Wed, Apr 16, 2014 at 1:49 AM, Alexander Shiyan <shc_work@mail.ru> wrote:
> 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);
>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>

Applied.

Rob

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

* Re: [PATCH] of: add empty of_find_node_by_path() for !OF
  2014-04-16 12:26 ` Rob Herring
@ 2014-04-16 14:25   ` Mark Brown
  2014-04-16 14:32     ` Rob Herring
  0 siblings, 1 reply; 8+ messages in thread
From: Mark Brown @ 2014-04-16 14:25 UTC (permalink / raw)
  To: Rob Herring
  Cc: Stephen Rothwell, Linux-ALSA, Alexander Shiyan, Liam Girdwood,
	Takashi Iwai, Timur Tabi, Rob Herring, Grant Likely


[-- Attachment #1.1: Type: text/plain, Size: 781 bytes --]

On Wed, Apr 16, 2014 at 07:26:13AM -0500, Rob Herring wrote:
> On Wed, Apr 16, 2014 at 1:49 AM, Alexander Shiyan <shc_work@mail.ru> wrote:

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

> > Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > Signed-off-by: Alexander Shiyan <shc_work@mail.ru>

> 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.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: [PATCH] of: add empty of_find_node_by_path() for !OF
  2014-04-16 14:25   ` Mark Brown
@ 2014-04-16 14:32     ` Rob Herring
  2014-04-16 16:03       ` Mark Brown
  0 siblings, 1 reply; 8+ messages in thread
From: Rob Herring @ 2014-04-16 14:32 UTC (permalink / raw)
  To: Mark Brown
  Cc: Stephen Rothwell, Linux-ALSA, Alexander Shiyan, Liam Girdwood,
	Takashi Iwai, Timur Tabi, Rob Herring, Grant Likely

On Wed, Apr 16, 2014 at 9:25 AM, Mark Brown <broonie@kernel.org> wrote:
> On Wed, Apr 16, 2014 at 07:26:13AM -0500, Rob Herring wrote:
>> On Wed, Apr 16, 2014 at 1:49 AM, Alexander Shiyan <shc_work@mail.ru> wrote:
>
>> > 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);
>
>> > Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
>> > Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
>
>> 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

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

* Re: [PATCH] of: add empty of_find_node_by_path() for !OF
  2014-04-16 14:32     ` Rob Herring
@ 2014-04-16 16:03       ` Mark Brown
  2014-04-16 16:10         ` Rob Herring
  0 siblings, 1 reply; 8+ messages in thread
From: Mark Brown @ 2014-04-16 16:03 UTC (permalink / raw)
  To: Rob Herring
  Cc: Stephen Rothwell, Linux-ALSA, Alexander Shiyan, Liam Girdwood,
	Takashi Iwai, Timur Tabi, Rob Herring, Grant Likely


[-- Attachment #1.1: Type: text/plain, Size: 580 bytes --]

On Wed, Apr 16, 2014 at 09:32:37AM -0500, Rob Herring wrote:
> On Wed, Apr 16, 2014 at 9:25 AM, Mark Brown <broonie@kernel.org> wrote:

> > 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?

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: [PATCH] of: add empty of_find_node_by_path() for !OF
  2014-04-16 16:03       ` Mark Brown
@ 2014-04-16 16:10         ` Rob Herring
  2014-04-16 17:15           ` Mark Brown
  0 siblings, 1 reply; 8+ messages in thread
From: Rob Herring @ 2014-04-16 16:10 UTC (permalink / raw)
  To: Mark Brown
  Cc: Stephen Rothwell, Linux-ALSA, Alexander Shiyan, Liam Girdwood,
	Takashi Iwai, Timur Tabi, Rob Herring, Grant Likely

On Wed, Apr 16, 2014 at 11:03 AM, Mark Brown <broonie@kernel.org> wrote:
> On Wed, Apr 16, 2014 at 09:32:37AM -0500, Rob Herring wrote:
>> On Wed, Apr 16, 2014 at 9:25 AM, Mark Brown <broonie@kernel.org> wrote:
>
>> > 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?

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

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

* Re: [PATCH] of: add empty of_find_node_by_path() for !OF
  2014-04-16 16:10         ` Rob Herring
@ 2014-04-16 17:15           ` Mark Brown
  2014-04-16 17:39             ` Rob Herring
  0 siblings, 1 reply; 8+ messages in thread
From: Mark Brown @ 2014-04-16 17:15 UTC (permalink / raw)
  To: Rob Herring
  Cc: Stephen Rothwell, Linux-ALSA, Alexander Shiyan, Liam Girdwood,
	Takashi Iwai, Timur Tabi, Rob Herring, Grant Likely


[-- Attachment #1.1: Type: text/plain, Size: 360 bytes --]

On Wed, Apr 16, 2014 at 11:10:15AM -0500, Rob Herring wrote:

> 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.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: [PATCH] of: add empty of_find_node_by_path() for !OF
  2014-04-16 17:15           ` Mark Brown
@ 2014-04-16 17:39             ` Rob Herring
  0 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2014-04-16 17:39 UTC (permalink / raw)
  To: Mark Brown
  Cc: Stephen Rothwell, Linux-ALSA, Alexander Shiyan, Liam Girdwood,
	Takashi Iwai, Timur Tabi, Rob Herring, Grant Likely

On Wed, Apr 16, 2014 at 12:15 PM, Mark Brown <broonie@kernel.org> wrote:
> On Wed, Apr 16, 2014 at 11:10:15AM -0500, Rob Herring wrote:
>
>> 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

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

end of thread, other threads:[~2014-04-16 17:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-16  6:49 [PATCH] of: add empty of_find_node_by_path() for !OF Alexander Shiyan
2014-04-16 12:26 ` Rob Herring
2014-04-16 14:25   ` Mark Brown
2014-04-16 14:32     ` Rob Herring
2014-04-16 16:03       ` Mark Brown
2014-04-16 16:10         ` Rob Herring
2014-04-16 17:15           ` Mark Brown
2014-04-16 17:39             ` Rob Herring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.