Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 103cf7b0 authored by Aditya Bavanari's avatar Aditya Bavanari
Browse files

ASoC: msm: Fix kernel crash in "Speaker Function" mixer control



Use snd_soc_kcontrol_codec instead of snd_kcontrol_chip
to obtain the codec information from the kcontrol.

CRs-Fixed: 2034533
Change-Id: I8b5424400ce668756ac23cbcbd6e1cec79b6255c
Signed-off-by: default avatarAditya Bavanari <abavanar@codeaurora.org>
parent 0a56af85
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -622,7 +622,7 @@ static int apq8084_get_spk(struct snd_kcontrol *kcontrol,
static int apq8084_set_spk(struct snd_kcontrol *kcontrol,
			   struct snd_ctl_elem_value *ucontrol)
{
	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);

	pr_debug("%s()\n", __func__);
	if (apq8084_spk_control == ucontrol->value.integer.value[0])
+1 −1
Original line number Diff line number Diff line
@@ -809,7 +809,7 @@ static void mdm_ext_control(struct snd_soc_codec *codec)
static int mdm_mi2s_set_spk(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{
	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);

	pr_debug("%s()\n", __func__);

+2 −2
Original line number Diff line number Diff line
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -732,7 +732,7 @@ static void mdm_ext_control(struct snd_soc_codec *codec)
static int mdm_mi2s_set_spk(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{
	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);

	pr_debug("%s()\n", __func__);

+1 −1
Original line number Diff line number Diff line
@@ -872,7 +872,7 @@ static void mdm_ext_control(struct snd_soc_codec *codec)
static int mdm_mi2s_set_spk(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol)
{
	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);

	pr_debug("%s()\n", __func__);

+1 −1
Original line number Diff line number Diff line
@@ -460,7 +460,7 @@ static int msm8952_get_spk(struct snd_kcontrol *kcontrol,
static int msm8952_set_spk(struct snd_kcontrol *kcontrol,
		       struct snd_ctl_elem_value *ucontrol)
{
	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);

	pr_debug("%s()\n", __func__);
	if (msm8952_spk_control == ucontrol->value.integer.value[0])
Loading