struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
- struct extn *p_extn = dev_get_drvdata(component->dev);
+ struct extn *p_extn = snd_kcontrol_chip(kcontrol);
+
+ if (!p_extn)
+ return 0;
ucontrol->value.integer.value[0] = p_extn->arc_src;
struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
- struct extn *p_extn = dev_get_drvdata(component->dev);
+ struct extn *p_extn = snd_kcontrol_chip(kcontrol);
+
+ if (!p_extn)
+ return 0;
p_extn->arc_src = ucontrol->value.integer.value[0];
struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
- struct extn *p_extn = dev_get_drvdata(component->dev);
+ struct extn *p_extn = snd_kcontrol_chip(kcontrol);
+
+ if (!p_extn)
+ return 0;
ucontrol->value.integer.value[0] = p_extn->arc_en;
struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
- struct extn *p_extn = dev_get_drvdata(component->dev);
+ struct extn *p_extn = snd_kcontrol_chip(kcontrol);
+
+ if (!p_extn)
+ return 0;
p_extn->arc_en = ucontrol->value.integer.value[0];
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
struct extn *p_extn = dev_get_drvdata(component->dev);
+ if (!p_extn)
+ return 0;
+
ucontrol->value.integer.value[0] = p_extn->hdmirx_mode;
return 0;
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
struct extn *p_extn = dev_get_drvdata(component->dev);
+ if (!p_extn)
+ return 0;
+
p_extn->hdmirx_mode = ucontrol->value.integer.value[0];
return 0;
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
struct extn *p_extn = dev_get_drvdata(component->dev);
+ if (!p_extn)
+ return 0;
+
ucontrol->value.enumerated.item[0] =
hdmiin_check_audio_type(p_extn);
for (i = 0; i < DYNC_KCNTL_CNT; i++) {
p_extn->controls[i] =
- snd_ctl_new1(&extn_arc_controls[i], NULL);
+ snd_ctl_new1(&extn_arc_controls[i], p_extn);
err = snd_ctl_add(card, p_extn->controls[i]);
if (err < 0)
goto __error;
/* Default: PAO mode */
p_extn->hdmirx_mode = 1;
- ret = snd_soc_register_component(&pdev->dev,
- &extn_component,
- extn_dai,
- ARRAY_SIZE(extn_dai));
+ ret = devm_snd_soc_register_component(&pdev->dev,
+ &extn_component,
+ extn_dai,
+ ARRAY_SIZE(extn_dai));
if (ret) {
dev_err(&pdev->dev,
"snd_soc_register_component failed\n");