diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2022-07-01 07:18:14 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-07-08 12:51:41 +0200 |
commit | 817a62108dfacebd548e38451bf0e7eee023e97f (patch) | |
tree | 426e7a5fa43d54edcb77a5a3a9c4cc6a5022e008 /sound/soc/generic | |
parent | ASoC: fsl_utils: Don't use plain integer as NULL pointer (diff) | |
download | linux-817a62108dfacebd548e38451bf0e7eee023e97f.tar.xz linux-817a62108dfacebd548e38451bf0e7eee023e97f.zip |
ASoC: audio-graph-card2.c: use of_property_read_u32() for rate
Audio Graph Card2 is using of_get_property(), but it should use
of_property_read_u32() to getting rate. Otherwise the setting will be
strange value. This patch fixup it.
Fixes: c3a15c92a67b701 ("ASoC: audio-graph-card2: add Codec2Codec support")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87h741s961.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/generic')
-rw-r--r-- | sound/soc/generic/audio-graph-card2.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c index d34b29a49268..8e0628e6f2a0 100644 --- a/sound/soc/generic/audio-graph-card2.c +++ b/sound/soc/generic/audio-graph-card2.c @@ -856,7 +856,7 @@ int audio_graph2_link_c2c(struct asoc_simple_priv *priv, struct device_node *port0, *port1, *ports; struct device_node *codec0_port, *codec1_port; struct device_node *ep0, *ep1; - u32 val; + u32 val = 0; int ret = -EINVAL; /* @@ -880,7 +880,8 @@ int audio_graph2_link_c2c(struct asoc_simple_priv *priv, ports = of_get_parent(port0); port1 = of_get_next_child(ports, lnk); - if (!of_get_property(ports, "rate", &val)) { + of_property_read_u32(ports, "rate", &val); + if (!val) { struct device *dev = simple_priv_to_dev(priv); dev_err(dev, "Codec2Codec needs rate settings\n"); |