linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: simple-card: fix regression in clock rate lookup
@ 2014-09-08 11:14 Arnd Bergmann
  2014-09-10 10:56 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2014-09-08 11:14 UTC (permalink / raw)
  To: linux-arm-kernel

Commit 7c7b9cf53d284f ("ASoC: simple-card: fixup cpu_dai_name
clear case") changed the way that "sound-dai" properties are handled,
which leads to the clock frequency not being picked up from the
node that the phandle points to, as correctly identified by gcc
with this warning:

sound/soc/generic/simple-card.c: In function 'asoc_simple_card_sub_parse_of':
sound/soc/generic/simple-card.c:165:7: warning: 'node' may be used uninitialized in this function [-Wmaybe-uninitialized]

This restores the previous behavior by using the node from
of_parse_phandle_with_args() that was previously being
returned from of_parse_phandle().

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index b563850c43f4..a0440bd533d5 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -116,7 +116,6 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
 			      int *args_count)
 {
 	struct of_phandle_args args;
-	struct device_node *node;
 	struct clk *clk;
 	u32 val;
 	int ret;
@@ -162,7 +161,7 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
 	} else if (!of_property_read_u32(np, "system-clock-frequency", &val)) {
 		dai->sysclk = val;
 	} else {
-		clk = of_clk_get(node, 0);
+		clk = of_clk_get(args.np, 0);
 		if (!IS_ERR(clk))
 			dai->sysclk = clk_get_rate(clk);
 	}

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

* [PATCH] ASoC: simple-card: fix regression in clock rate lookup
  2014-09-08 11:14 [PATCH] ASoC: simple-card: fix regression in clock rate lookup Arnd Bergmann
@ 2014-09-10 10:56 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2014-09-10 10:56 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Sep 08, 2014 at 01:14:05PM +0200, Arnd Bergmann wrote:
> Commit 7c7b9cf53d284f ("ASoC: simple-card: fixup cpu_dai_name
> clear case") changed the way that "sound-dai" properties are handled,
> which leads to the clock frequency not being picked up from the
> node that the phandle points to, as correctly identified by gcc
> with this warning:

Applied, thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140910/5368762a/attachment-0001.sig>

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

end of thread, other threads:[~2014-09-10 10:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-08 11:14 [PATCH] ASoC: simple-card: fix regression in clock rate lookup Arnd Bergmann
2014-09-10 10:56 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).