From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F4FFC433E0 for ; Sun, 17 May 2020 17:18:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EEB47207ED for ; Sun, 17 May 2020 17:18:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nG7kVCyO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726537AbgEQRSI (ORCPT ); Sun, 17 May 2020 13:18:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726242AbgEQRSI (ORCPT ); Sun, 17 May 2020 13:18:08 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6478EC061A0C for ; Sun, 17 May 2020 10:18:08 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id s20so3173728plp.6 for ; Sun, 17 May 2020 10:18:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=6CUGp4WjdnQ3LuIcb0IdKCrKwR/TmCSik43rIlrbJgQ=; b=nG7kVCyORyLUEXi0oqMaX5KYPv50THkfi/WTWXSyG/hIS11jE7d/rwtRNHqVA8Sn2m OhlsKo3DCjiKrDh/9ml5IBlrCWSCLkBiiJhQKMtnggTnETU3rCoXmDEUhYyYuYMa+XWb nb3h3u+BUkp86TP+Fw0BT/iOWovbXYA9QPSdjJSqSx2eRRz4X17+YbqqJq4opqknMVtZ avoaRlOxXIcqXbaV1jYkLWOEmOhJoq7nJgzpK8d73iu3RCImn+JBPX0vQ3XLZJAV9EvL 6e1H8SXqGS8fYqb879I27EhiPge8tyk1oyRME2cfaRHMliK8761Jp0TpkZEx0f7BfZQ6 oTbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=6CUGp4WjdnQ3LuIcb0IdKCrKwR/TmCSik43rIlrbJgQ=; b=DrkyhuWISvWoRCu7qtZ3ux4ipf2PsvzSnbraI0XPByAc8dh8SyDp9ACDW5UadiytMh x9w9Qn6989lZtjXmfSIvGUo8UKX/dPDnhYTZErZAGXQX7KTNxwtpGeccAM7q8/8z6FLF 2C9FDzK61pmseBAptpfPmGF/dOyeRPrRp6wnSeWElZmNIqfMX/U8/wqLeui6X+Rykt7z o9g9rRx9HJW/pRbIE96u6WkomVunRx3s1ivwhHg8hSXLsOQICaOCB1C3pRnHtfFfXZt2 3t1AZOx1mZNzg5tOXlhirxSiMt1dCO9u1I6cxzQV2Lg7wJEUKatU4zuGXkGVu4kQO6PE MBtQ== X-Gm-Message-State: AOAM530JkmUnF3ByvSHzL0EY3lXk0gCY4DF1m6WPVdvSDInIHGLZNXxF 8I6n1/KjhvFOa6XMYso8DbOmnSxPe2EeAw== X-Google-Smtp-Source: ABdhPJyG/ta1akzxYW2mBGpDfEHGnnDIL0etFZ6SE2nh7YwV/AMduWX/m2jY0ICvL0v2rpuUk5Fvtg== X-Received: by 2002:a17:902:c406:: with SMTP id k6mr12249441plk.203.1589735887739; Sun, 17 May 2020 10:18:07 -0700 (PDT) Received: from cvds-vagarw7.iind.intel.com (fmdmzpr03-ext.fm.intel.com. [192.55.54.38]) by smtp.googlemail.com with ESMTPSA id n69sm6513900pjc.8.2020.05.17.10.18.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 May 2020 10:18:07 -0700 (PDT) From: Vaibhav Agarwal To: Greg Kroah-Hartman , Alex Elder , Johan Hovold , Mark Greer Cc: greybus-dev@lists.linaro.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Alexandre Belloni , Vaibhav Agarwal Subject: [PATCH V1 4/6] staging: greybus: audio: Resolve compilation error in topology parser Date: Sun, 17 May 2020 22:47:19 +0530 Message-Id: <6131fec4cf9e18dbf70fa7f992de9d588299ee18.1589734179.git.vaibhav.sr@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix compilation errors for GB Audio topology parser code with recent kernel versions. Signed-off-by: Vaibhav Agarwal --- drivers/staging/greybus/audio_topology.c | 130 +++++++++++++++---------------- 1 file changed, 61 insertions(+), 69 deletions(-) diff --git a/drivers/staging/greybus/audio_topology.c b/drivers/staging/greybus/audio_topology.c index 4ac30accf226..7d5e87341a5c 100644 --- a/drivers/staging/greybus/audio_topology.c +++ b/drivers/staging/greybus/audio_topology.c @@ -5,8 +5,8 @@ * Copyright 2015-2016 Linaro Ltd. */ +#include #include "audio_codec.h" -#include "greybus_protocols.h" #define GBAUDIO_INVALID_ID 0xFF @@ -165,15 +165,15 @@ static int gbcodec_mixer_ctl_info(struct snd_kcontrol *kcontrol, struct gbaudio_ctl_pvt *data; struct gb_audio_ctl_elem_info *info; struct gbaudio_module_info *module; - struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); - struct gbaudio_codec_info *gbcodec = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *comp = snd_soc_kcontrol_component(kcontrol); + struct gbaudio_codec_info *gb = snd_soc_component_get_drvdata(comp); - dev_dbg(codec->dev, "Entered %s:%s\n", __func__, kcontrol->id.name); + dev_dbg(comp->dev, "Entered %s:%s\n", __func__, kcontrol->id.name); data = (struct gbaudio_ctl_pvt *)kcontrol->private_value; info = (struct gb_audio_ctl_elem_info *)data->info; if (!info) { - dev_err(codec->dev, "NULL info for %s\n", uinfo->id.name); + dev_err(comp->dev, "NULL info for %s\n", uinfo->id.name); return -EINVAL; } @@ -193,7 +193,7 @@ static int gbcodec_mixer_ctl_info(struct snd_kcontrol *kcontrol, uinfo->value.enumerated.items = max; if (uinfo->value.enumerated.item > max - 1) uinfo->value.enumerated.item = max - 1; - module = find_gb_module(gbcodec, kcontrol->id.name); + module = find_gb_module(gb, kcontrol->id.name); if (!module) return -EINVAL; name = gbaudio_map_controlid(module, data->ctl_id, @@ -201,7 +201,7 @@ static int gbcodec_mixer_ctl_info(struct snd_kcontrol *kcontrol, strlcpy(uinfo->value.enumerated.name, name, NAME_SIZE); break; default: - dev_err(codec->dev, "Invalid type: %d for %s:kcontrol\n", + dev_err(comp->dev, "Invalid type: %d for %s:kcontrol\n", info->type, kcontrol->id.name); break; } @@ -216,11 +216,11 @@ static int gbcodec_mixer_ctl_get(struct snd_kcontrol *kcontrol, struct gbaudio_ctl_pvt *data; struct gb_audio_ctl_elem_value gbvalue; struct gbaudio_module_info *module; - struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); - struct gbaudio_codec_info *gb = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *comp = snd_soc_kcontrol_component(kcontrol); + struct gbaudio_codec_info *gb = snd_soc_component_get_drvdata(comp); struct gb_bundle *bundle; - dev_dbg(codec->dev, "Entered %s:%s\n", __func__, kcontrol->id.name); + dev_dbg(comp->dev, "Entered %s:%s\n", __func__, kcontrol->id.name); module = find_gb_module(gb, kcontrol->id.name); if (!module) return -EINVAL; @@ -239,7 +239,7 @@ static int gbcodec_mixer_ctl_get(struct snd_kcontrol *kcontrol, gb_pm_runtime_put_autosuspend(bundle); if (ret) { - dev_err_ratelimited(codec->dev, "%d:Error in %s for %s\n", ret, + dev_err_ratelimited(comp->dev, "%d:Error in %s for %s\n", ret, __func__, kcontrol->id.name); return ret; } @@ -262,7 +262,7 @@ static int gbcodec_mixer_ctl_get(struct snd_kcontrol *kcontrol, le32_to_cpu(gbvalue.value.enumerated_item[1]); break; default: - dev_err(codec->dev, "Invalid type: %d for %s:kcontrol\n", + dev_err(comp->dev, "Invalid type: %d for %s:kcontrol\n", info->type, kcontrol->id.name); ret = -EINVAL; break; @@ -278,11 +278,11 @@ static int gbcodec_mixer_ctl_put(struct snd_kcontrol *kcontrol, struct gbaudio_ctl_pvt *data; struct gb_audio_ctl_elem_value gbvalue; struct gbaudio_module_info *module; - struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); - struct gbaudio_codec_info *gb = snd_soc_codec_get_drvdata(codec); + struct snd_soc_component *comp = snd_soc_kcontrol_component(kcontrol); + struct gbaudio_codec_info *gb = snd_soc_component_get_drvdata(comp); struct gb_bundle *bundle; - dev_dbg(codec->dev, "Entered %s:%s\n", __func__, kcontrol->id.name); + dev_dbg(comp->dev, "Entered %s:%s\n", __func__, kcontrol->id.name); module = find_gb_module(gb, kcontrol->id.name); if (!module) return -EINVAL; @@ -309,7 +309,7 @@ static int gbcodec_mixer_ctl_put(struct snd_kcontrol *kcontrol, cpu_to_le32(ucontrol->value.enumerated.item[1]); break; default: - dev_err(codec->dev, "Invalid type: %d for %s:kcontrol\n", + dev_err(comp->dev, "Invalid type: %d for %s:kcontrol\n", info->type, kcontrol->id.name); ret = -EINVAL; break; @@ -328,7 +328,7 @@ static int gbcodec_mixer_ctl_put(struct snd_kcontrol *kcontrol, gb_pm_runtime_put_autosuspend(bundle); if (ret) { - dev_err_ratelimited(codec->dev, "%d:Error in %s for %s\n", ret, + dev_err_ratelimited(comp->dev, "%d:Error in %s for %s\n", ret, __func__, kcontrol->id.name); } @@ -352,11 +352,7 @@ static int gbcodec_mixer_dapm_ctl_info(struct snd_kcontrol *kcontrol, int platform_max, platform_min; struct gbaudio_ctl_pvt *data; struct gb_audio_ctl_elem_info *info; - struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol); - struct snd_soc_dapm_widget *widget = wlist->widgets[0]; - struct snd_soc_codec *codec = widget->codec; - dev_dbg(codec->dev, "Entered %s:%s\n", __func__, kcontrol->id.name); data = (struct gbaudio_ctl_pvt *)kcontrol->private_value; info = (struct gb_audio_ctl_elem_info *)data->info; @@ -387,11 +383,11 @@ static int gbcodec_mixer_dapm_ctl_get(struct snd_kcontrol *kcontrol, struct gbaudio_module_info *module; struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol); struct snd_soc_dapm_widget *widget = wlist->widgets[0]; - struct snd_soc_codec *codec = widget->codec; - struct gbaudio_codec_info *gb = snd_soc_codec_get_drvdata(codec); + struct device *codec_dev = widget->dapm->dev; + struct gbaudio_codec_info *gb = dev_get_drvdata(codec_dev); struct gb_bundle *bundle; - dev_dbg(codec->dev, "Entered %s:%s\n", __func__, kcontrol->id.name); + dev_dbg(codec_dev, "Entered %s:%s\n", __func__, kcontrol->id.name); module = find_gb_module(gb, kcontrol->id.name); if (!module) return -EINVAL; @@ -415,7 +411,7 @@ static int gbcodec_mixer_dapm_ctl_get(struct snd_kcontrol *kcontrol, gb_pm_runtime_put_autosuspend(bundle); if (ret) { - dev_err_ratelimited(codec->dev, "%d:Error in %s for %s\n", ret, + dev_err_ratelimited(codec_dev, "%d:Error in %s for %s\n", ret, __func__, kcontrol->id.name); return ret; } @@ -429,7 +425,7 @@ static int gbcodec_mixer_dapm_ctl_get(struct snd_kcontrol *kcontrol, static int gbcodec_mixer_dapm_ctl_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - int ret, wi, max, connect; + int ret, wi, max; unsigned int mask, val; struct gb_audio_ctl_elem_info *info; struct gbaudio_ctl_pvt *data; @@ -437,11 +433,12 @@ static int gbcodec_mixer_dapm_ctl_put(struct snd_kcontrol *kcontrol, struct gbaudio_module_info *module; struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol); struct snd_soc_dapm_widget *widget = wlist->widgets[0]; - struct snd_soc_codec *codec = widget->codec; - struct gbaudio_codec_info *gb = snd_soc_codec_get_drvdata(codec); + struct device *codec_dev = widget->dapm->dev; + struct gbaudio_codec_info *gb = dev_get_drvdata(codec_dev); + struct snd_soc_dapm_update *update = NULL; struct gb_bundle *bundle; - dev_dbg(codec->dev, "Entered %s:%s\n", __func__, kcontrol->id.name); + dev_dbg(codec_dev, "Entered %s:%s\n", __func__, kcontrol->id.name); module = find_gb_module(gb, kcontrol->id.name); if (!module) return -EINVAL; @@ -458,17 +455,13 @@ static int gbcodec_mixer_dapm_ctl_put(struct snd_kcontrol *kcontrol, max = le32_to_cpu(info->value.integer.max); mask = (1 << fls(max)) - 1; val = ucontrol->value.integer.value[0] & mask; - connect = !!val; /* update ucontrol */ if (gbvalue.value.integer_value[0] != val) { for (wi = 0; wi < wlist->num_widgets; wi++) { widget = wlist->widgets[wi]; - - widget->value = val; - widget->dapm->update = NULL; - snd_soc_dapm_mixer_update_power(widget, kcontrol, - connect); + snd_soc_dapm_mixer_update_power(widget->dapm, kcontrol, + val, update); } gbvalue.value.integer_value[0] = cpu_to_le32(ucontrol->value.integer.value[0]); @@ -484,7 +477,7 @@ static int gbcodec_mixer_dapm_ctl_put(struct snd_kcontrol *kcontrol, gb_pm_runtime_put_autosuspend(bundle); if (ret) { - dev_err_ratelimited(codec->dev, + dev_err_ratelimited(codec_dev, "%d:Error in %s for %s\n", ret, __func__, kcontrol->id.name); return ret; @@ -553,11 +546,11 @@ static int gbcodec_enum_ctl_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { int ret, ctl_id; - struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); + struct snd_soc_component *comp = snd_soc_kcontrol_component(kcontrol); + struct gbaudio_codec_info *gb = snd_soc_component_get_drvdata(comp); struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; struct gb_audio_ctl_elem_value gbvalue; struct gbaudio_module_info *module; - struct gbaudio_codec_info *gb = snd_soc_codec_get_drvdata(codec); struct gb_bundle *bundle; module = find_gb_module(gb, kcontrol->id.name); @@ -580,7 +573,7 @@ static int gbcodec_enum_ctl_get(struct snd_kcontrol *kcontrol, gb_pm_runtime_put_autosuspend(bundle); if (ret) { - dev_err_ratelimited(codec->dev, "%d:Error in %s for %s\n", ret, + dev_err_ratelimited(comp->dev, "%d:Error in %s for %s\n", ret, __func__, kcontrol->id.name); return ret; } @@ -598,11 +591,11 @@ static int gbcodec_enum_ctl_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { int ret, ctl_id; - struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); + struct snd_soc_component *comp = snd_soc_kcontrol_component(kcontrol); + struct gbaudio_codec_info *gb = snd_soc_component_get_drvdata(comp); struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; struct gb_audio_ctl_elem_value gbvalue; struct gbaudio_module_info *module; - struct gbaudio_codec_info *gb = snd_soc_codec_get_drvdata(codec); struct gb_bundle *bundle; module = find_gb_module(gb, kcontrol->id.name); @@ -613,13 +606,13 @@ static int gbcodec_enum_ctl_put(struct snd_kcontrol *kcontrol, if (ctl_id < 0) return -EINVAL; - if (ucontrol->value.enumerated.item[0] > e->max - 1) + if (ucontrol->value.enumerated.item[0] > e->items - 1) return -EINVAL; gbvalue.value.enumerated_item[0] = cpu_to_le32(ucontrol->value.enumerated.item[0]); if (e->shift_l != e->shift_r) { - if (ucontrol->value.enumerated.item[1] > e->max - 1) + if (ucontrol->value.enumerated.item[1] > e->items - 1) return -EINVAL; gbvalue.value.enumerated_item[1] = cpu_to_le32(ucontrol->value.enumerated.item[1]); @@ -637,8 +630,8 @@ static int gbcodec_enum_ctl_put(struct snd_kcontrol *kcontrol, gb_pm_runtime_put_autosuspend(bundle); if (ret) { - dev_err_ratelimited(codec->dev, "%d:Error in %s for %s\n", ret, - __func__, kcontrol->id.name); + dev_err_ratelimited(comp->dev, "%d:Error in %s for %s\n", + ret, __func__, kcontrol->id.name); } return ret; @@ -659,13 +652,13 @@ static int gbaudio_tplg_create_enum_kctl(struct gbaudio_module_info *gb, gb_enum = &ctl->info.value.enumerated; /* since count=1, and reg is dummy */ - gbe->max = le32_to_cpu(gb_enum->items); + gbe->items = le32_to_cpu(gb_enum->items); gbe->texts = gb_generate_enum_strings(gb, gb_enum); /* debug enum info */ - dev_dbg(gb->dev, "Max:%d, name_length:%d\n", gbe->max, + dev_dbg(gb->dev, "Max:%d, name_length:%d\n", gbe->items, le16_to_cpu(gb_enum->names_length)); - for (i = 0; i < gbe->max; i++) + for (i = 0; i < gbe->items; i++) dev_dbg(gb->dev, "src[%d]: %s\n", i, gbe->texts[i]); *kctl = (struct snd_kcontrol_new) @@ -720,8 +713,8 @@ static int gbcodec_enum_dapm_ctl_get(struct snd_kcontrol *kcontrol, struct snd_soc_dapm_widget *widget = wlist->widgets[0]; struct gbaudio_module_info *module; struct gb_audio_ctl_elem_value gbvalue; - struct snd_soc_codec *codec = widget->codec; - struct gbaudio_codec_info *gb = snd_soc_codec_get_drvdata(codec); + struct device *codec_dev = widget->dapm->dev; + struct gbaudio_codec_info *gb = dev_get_drvdata(codec_dev); struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; struct gb_bundle *bundle; @@ -745,7 +738,7 @@ static int gbcodec_enum_dapm_ctl_get(struct snd_kcontrol *kcontrol, gb_pm_runtime_put_autosuspend(bundle); if (ret) { - dev_err_ratelimited(codec->dev, "%d:Error in %s for %s\n", ret, + dev_err_ratelimited(codec_dev, "%d:Error in %s for %s\n", ret, __func__, kcontrol->id.name); return ret; } @@ -768,12 +761,13 @@ static int gbcodec_enum_dapm_ctl_put(struct snd_kcontrol *kcontrol, struct snd_soc_dapm_widget *widget = wlist->widgets[0]; struct gb_audio_ctl_elem_value gbvalue; struct gbaudio_module_info *module; - struct snd_soc_codec *codec = widget->codec; - struct gbaudio_codec_info *gb = snd_soc_codec_get_drvdata(codec); + struct device *codec_dev = widget->dapm->dev; + struct gbaudio_codec_info *gb = dev_get_drvdata(codec_dev); struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; struct gb_bundle *bundle; + struct snd_soc_dapm_update *update = NULL; - if (ucontrol->value.enumerated.item[0] > e->max - 1) + if (ucontrol->value.enumerated.item[0] > e->items - 1) return -EINVAL; module = find_gb_module(gb, kcontrol->id.name); @@ -797,7 +791,7 @@ static int gbcodec_enum_dapm_ctl_put(struct snd_kcontrol *kcontrol, gb_pm_runtime_put_autosuspend(bundle); if (ret) { - dev_err_ratelimited(codec->dev, "%d:Error in %s for %s\n", ret, + dev_err_ratelimited(codec_dev, "%d:Error in %s for %s\n", ret, __func__, kcontrol->id.name); return ret; } @@ -814,7 +808,7 @@ static int gbcodec_enum_dapm_ctl_put(struct snd_kcontrol *kcontrol, } if (e->shift_l != e->shift_r) { - if (ucontrol->value.enumerated.item[1] > e->max - 1) + if (ucontrol->value.enumerated.item[1] > e->items - 1) return -EINVAL; val |= ucontrol->value.enumerated.item[1] << e->shift_r; mask |= e->mask << e->shift_r; @@ -837,16 +831,14 @@ static int gbcodec_enum_dapm_ctl_put(struct snd_kcontrol *kcontrol, gb_pm_runtime_put_autosuspend(bundle); if (ret) { - dev_err_ratelimited(codec->dev, + dev_err_ratelimited(codec_dev, "%d:Error in %s for %s\n", ret, __func__, kcontrol->id.name); } for (wi = 0; wi < wlist->num_widgets; wi++) { widget = wlist->widgets[wi]; - - widget->value = val; - widget->dapm->update = NULL; - snd_soc_dapm_mux_update_power(widget, kcontrol, mux, e); + snd_soc_dapm_mux_update_power(widget->dapm, kcontrol, + val, e, update); } } @@ -868,13 +860,13 @@ static int gbaudio_tplg_create_enum_ctl(struct gbaudio_module_info *gb, gb_enum = &ctl->info.value.enumerated; /* since count=1, and reg is dummy */ - gbe->max = le32_to_cpu(gb_enum->items); + gbe->items = le32_to_cpu(gb_enum->items); gbe->texts = gb_generate_enum_strings(gb, gb_enum); /* debug enum info */ - dev_dbg(gb->dev, "Max:%d, name_length:%d\n", gbe->max, + dev_dbg(gb->dev, "Max:%d, name_length:%d\n", gbe->items, le16_to_cpu(gb_enum->names_length)); - for (i = 0; i < gbe->max; i++) + for (i = 0; i < gbe->items; i++) dev_dbg(gb->dev, "src[%d]: %s\n", i, gbe->texts[i]); *kctl = (struct snd_kcontrol_new) @@ -935,12 +927,12 @@ static int gbaudio_widget_event(struct snd_soc_dapm_widget *w, { int wid; int ret; - struct snd_soc_codec *codec = w->codec; - struct gbaudio_codec_info *gbcodec = snd_soc_codec_get_drvdata(codec); + struct device *codec_dev = w->dapm->dev; + struct gbaudio_codec_info *gbcodec = dev_get_drvdata(codec_dev); struct gbaudio_module_info *module; struct gb_bundle *bundle; - dev_dbg(codec->dev, "%s %s %d\n", __func__, w->name, event); + dev_dbg(codec_dev, "%s %s %d\n", __func__, w->name, event); /* Find relevant module */ module = find_gb_module(gbcodec, w->name); @@ -950,7 +942,7 @@ static int gbaudio_widget_event(struct snd_soc_dapm_widget *w, /* map name to widget id */ wid = gbaudio_map_widgetname(module, w->name); if (wid < 0) { - dev_err(codec->dev, "Invalid widget name:%s\n", w->name); + dev_err(codec_dev, "Invalid widget name:%s\n", w->name); return -EINVAL; } @@ -973,7 +965,7 @@ static int gbaudio_widget_event(struct snd_soc_dapm_widget *w, break; } if (ret) - dev_err_ratelimited(codec->dev, + dev_err_ratelimited(codec_dev, "%d: widget, event:%d failed:%d\n", wid, event, ret); -- 2.7.4