diff mbox series

ASoC: rt5682: Register clocks even when mclk is NULL

Message ID 20200612163111.11730-1-akshu.agrawal@amd.com (mailing list archive)
State New, archived
Headers show
Series ASoC: rt5682: Register clocks even when mclk is NULL | expand

Commit Message

Akshu Agrawal June 12, 2020, 4:31 p.m. UTC
Fixes kernel crash on platforms which do not have mclk exposed
in CCF framework. For these platforms have mclk as NULL and
continue to register clocks.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
---
 sound/soc/codecs/rt5682.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Comments

Mark Brown June 12, 2020, 4:34 p.m. UTC | #1
On Fri, Jun 12, 2020 at 10:01:11PM +0530, Akshu Agrawal wrote:
> Fixes kernel crash on platforms which do not have mclk exposed
> in CCF framework. For these platforms have mclk as NULL and
> continue to register clocks.

Derek already submitted this:

    https://lore.kernel.org/alsa-devel/1591938925-1070-5-git-send-email-derek.fang@realtek.com/T/#u
Agrawal, Akshu June 12, 2020, 4:46 p.m. UTC | #2
On 6/12/2020 10:04 PM, Mark Brown wrote:
> On Fri, Jun 12, 2020 at 10:01:11PM +0530, Akshu Agrawal wrote:
>> Fixes kernel crash on platforms which do not have mclk exposed
>> in CCF framework. For these platforms have mclk as NULL and
>> continue to register clocks.
> Derek already submitted this:
>
>      https://lore.kernel.org/alsa-devel/1591938925-1070-5-git-send-email-derek.fang@realtek.com/T/#u

Ok great. Thanks.
diff mbox series

Patch

diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c
index d3245123101d..7c8b8d839db8 100644
--- a/sound/soc/codecs/rt5682.c
+++ b/sound/soc/codecs/rt5682.c
@@ -2829,12 +2829,11 @@  static int rt5682_probe(struct snd_soc_component *component)
 				return ret;
 			}
 			rt5682->mclk = NULL;
-		} else {
-			/* Register CCF DAI clock control */
-			ret = rt5682_register_dai_clks(component);
-			if (ret)
-				return ret;
 		}
+		/* Register CCF DAI clock control */
+		ret = rt5682_register_dai_clks(component);
+		if (ret)
+			return ret;
 		/* Initial setup for CCF */
 		rt5682->lrck[RT5682_AIF1] = CLK_48;
 #endif