ASoC: codec: Update codec driver to component driver
Some alsa API are removed in kernel-4.19 which would cause
codec driver compile failure. Update codec driver to fix it.
Change-Id: Ie358ec1863082166958059c179300b453d2a03ad
Signed-off-by: Meng Wang <mengw@codeaurora.org>
diff --git a/asoc/codecs/wcdcal-hwdep.c b/asoc/codecs/wcdcal-hwdep.c
index 9c5d0e2..162c407 100644
--- a/asoc/codecs/wcdcal-hwdep.c
+++ b/asoc/codecs/wcdcal-hwdep.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
/*
- * Copyright (c) 2015, 2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2015, 2017-2018 The Linux Foundation. All rights reserved.
*
*/
#include <linux/kernel.h>
@@ -152,7 +152,8 @@
return 0;
}
-int wcd_cal_create_hwdep(void *data, int node, struct snd_soc_codec *codec)
+int wcd_cal_create_hwdep(void *data, int node,
+ struct snd_soc_component *component)
{
char hwname[40];
struct snd_hwdep *hwdep;
@@ -160,23 +161,23 @@
struct fw_info *fw_data = data;
int err, cal_bit;
- if (!fw_data || !codec) {
+ if (!fw_data || !component) {
pr_err("%s: wrong arguments passed\n", __func__);
return -EINVAL;
}
fw = fw_data->fw;
snprintf(hwname, strlen("Codec %s"), "Codec %s",
- codec->component.name);
- err = snd_hwdep_new(codec->component.card->snd_card,
+ component->name);
+ err = snd_hwdep_new(component->card->snd_card,
hwname, node, &hwdep);
if (err < 0) {
- dev_err(codec->dev, "%s: new hwdep failed %d\n",
+ dev_err(component->dev, "%s: new hwdep failed %d\n",
__func__, err);
return err;
}
snprintf(hwdep->name, strlen("Codec %s"), "Codec %s",
- codec->component.name);
+ component->name);
hwdep->iface = SNDRV_HWDEP_IFACE_AUDIO_CODEC;
hwdep->private_data = fw_data;
hwdep->ops.ioctl_compat = wcdcal_hwdep_ioctl_compat;
@@ -188,11 +189,8 @@
set_bit(WCDCAL_UNINITIALISED,
&fw_data->wcdcal_state[cal_bit]);
fw[cal_bit] = kzalloc(sizeof *(fw[cal_bit]), GFP_KERNEL);
- if (!fw[cal_bit]) {
- dev_err(codec->dev, "%s: no memory for %s cal\n",
- __func__, cal_name_info[cal_bit]);
+ if (!fw[cal_bit])
goto end;
- }
}
for_each_set_bit(cal_bit, fw_data->cal_bit, WCD9XXX_MAX_CAL) {
fw[cal_bit]->data = kzalloc(cal_size_info[cal_bit],