From patchwork Mon Apr 29 13:29:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 163027 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp1887966ill; Mon, 29 Apr 2019 06:30:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqzPZ5y8QuDUIqayGkJstAy8aoB600QXG+3L+H2N4WE9cQ4iodfpf20ZpySxXUTVc1nB4UPj X-Received: by 2002:a17:902:7b8e:: with SMTP id w14mr44761056pll.202.1556544610954; Mon, 29 Apr 2019 06:30:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556544610; cv=none; d=google.com; s=arc-20160816; b=G+xqm9i19m0hNh4KYyD5/5908pY0ent6k/jY6u7bAEvWSTABYb1uKO+9dJsbRVECSW V4RiHJGaZWjGaPeklDqKSciVUVOJchPXcc3rGtdBdAd2ZY8zLMq5l/OScSLkRfet6N7D gLG5Z1OJ3L0Q9VZFUpVfzRsIWm4ff1CNNjb7RtNdHjQYYfgNLqX7O4DooEq9jl9+5q6M 50L9WkZ/xqUn0wdUc7h30+hw0h/bC+EVp98uX1KRSxQqLfljQ5LlczEVmE3vJvWop4JD Qggd0px2qMuzkPzK+7GSU6Xc9La0mutBpTy8wn10cR81Htk9ir5VHpZX1dwrGR5uCxZI scWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=c2Ly6nFnbTUuYqirG7Hg6dg1zRcYgFT1GAPuXl6J8C8=; b=TMvbwEGIGjULFBajflxQ+01ov8pwGfHCZOc2QVKFFf8JfWZTV/wBLjvhc43Ex7yK5L GQII42PxoWbk4n8wnkoB8xYcVeKzw8Brc1Vr0be+oyoVDuZxu7h+YjzFcE0exW5z+Bdw HWhROFOeePXAZ/FRCptC1V8Q4B+uNPy+mQ3pbM5pbjMKTkj/HDcYJlosKSH3yX5KSCK+ RfF4kYFkqttjJqRtJYRIISrCkExeAkS0O/BUoSdroDtQy0TTZyqc+6Qi9Nl5lfM1I4fb reTKXUdGoGHCEO9gHjDBGJuJBJQHLs5j55RWIZBH6bYAWAn6FzbUWhnhwIcYzUos50BB 4VGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=meqj0rsJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p14si31403818pgb.292.2019.04.29.06.30.10; Mon, 29 Apr 2019 06:30:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=meqj0rsJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728299AbfD2NaF (ORCPT + 30 others); Mon, 29 Apr 2019 09:30:05 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:51753 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727046AbfD2N3z (ORCPT ); Mon, 29 Apr 2019 09:29:55 -0400 Received: by mail-wm1-f66.google.com with SMTP id 4so14104900wmf.1 for ; Mon, 29 Apr 2019 06:29:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=c2Ly6nFnbTUuYqirG7Hg6dg1zRcYgFT1GAPuXl6J8C8=; b=meqj0rsJv5rfBIShZLQunnMvrc8ItTEICy2+kAclCNP4u/MykXbVjfGB2rZlt3+NG8 0kXXs/AjAOB2zWPpqduLNYKK4WD+nT7H86fGbdVPXEA3IBi/rPUQSOWSWFGHXIpJw3gS VpwnuOvEyHRtvq17hw0O0lylYaxZV0eRkY2PknHzpbM8+q2P5biZpCQkFjQWcHzi4zhL CC1/4GTBYQwp/l4GSLsrOss2g/4OaEOEYetdNnJa3KWknO88apc6PrwVP0C816M4Gniz Qm+xY1TJ17Kqn7M9V0EIOYMQrG6u9ijK54KnoLq+iXPVWBf2904tvI2g/pqxJwkDa1eh KYWA== 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:mime-version:content-transfer-encoding; bh=c2Ly6nFnbTUuYqirG7Hg6dg1zRcYgFT1GAPuXl6J8C8=; b=fjcSlA2GSEZLQKnr9KUR95NoRbSQEFF1Ab1C/x55PzCRH9n+0UmqG1KvsMkFpAnPAS 35gTsqsDxd8quDZpBKXoo1PaG224SYYLByOrsFEPE14oCcNqqhZqls+Nq1ZcMBdqPixy /CRdASUlpT+pXn/8E9hNxUxukqr0pqUqtBbbj40fq1mYXkDpZyTv1oPl0yKbb4qUg7CG zOBUgbhSdMfpn0/NMhC11VBV+h59fP6N00B/QSHTDbhV5gia+DW9qhx96/NOZteA8w5m FOoECqyBUJYmjtJw586sosgR3RpjMS0APV63ihNhDmS9BHprDId5rWLRgm61RD825FtB Mqvw== X-Gm-Message-State: APjAAAVTeOKJ5JdhpYWIh5UvREDXF7F2TJ9LvBLYtIcfzoNwVIXc2csx Ezyz2GviVV5S6fxH7H3Yrfum7w== X-Received: by 2002:a05:600c:204d:: with SMTP id p13mr2263305wmg.53.1556544593778; Mon, 29 Apr 2019 06:29:53 -0700 (PDT) Received: from boomer.local (lmontsouris-657-1-212-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id s17sm2857593wra.94.2019.04.29.06.29.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Apr 2019 06:29:53 -0700 (PDT) From: Jerome Brunet To: Mark Brown , Liam Girdwood Cc: Jerome Brunet , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, patchwork-bot+notify@kernel.org Subject: [PATCH 5/6] ASoC: hdmi-codec: remove reference to the dai drivers in the private data Date: Mon, 29 Apr 2019 15:29:42 +0200 Message-Id: <20190429132943.16269-6-jbrunet@baylibre.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190429132943.16269-1-jbrunet@baylibre.com> References: <20190429132943.16269-1-jbrunet@baylibre.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Keeping the a pointer to the dai drivers is not necessary. It is not used by the hdmi_codec after the probe. Even if it was used, the 'struct snd_soc_dai_driver' can accessed through the 'struct snd_soc_dai' so keeping the pointer in the private data structure is not useful. Signed-off-by: Jerome Brunet --- sound/soc/codecs/hdmi-codec.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) -- 2.20.1 diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c index 717d0949f8b4..bcc2e5c3bf43 100644 --- a/sound/soc/codecs/hdmi-codec.c +++ b/sound/soc/codecs/hdmi-codec.c @@ -278,7 +278,6 @@ static const struct hdmi_codec_cea_spk_alloc hdmi_codec_channel_alloc[] = { struct hdmi_codec_priv { struct hdmi_codec_pdata hcd; - struct snd_soc_dai_driver *daidrv; struct hdmi_codec_daifmt daifmt[2]; uint8_t eld[MAX_ELD_BYTES]; struct snd_pcm_chmap *chmap_info; @@ -720,6 +719,7 @@ static const struct snd_soc_component_driver hdmi_driver = { static int hdmi_codec_probe(struct platform_device *pdev) { struct hdmi_codec_pdata *hcd = pdev->dev.platform_data; + struct snd_soc_dai_driver *daidrv; struct device *dev = &pdev->dev; struct hdmi_codec_priv *hcp; int dai_count, i = 0; @@ -742,25 +742,23 @@ static int hdmi_codec_probe(struct platform_device *pdev) return -ENOMEM; hcp->hcd = *hcd; - hcp->daidrv = devm_kcalloc(dev, dai_count, sizeof(*hcp->daidrv), - GFP_KERNEL); - if (!hcp->daidrv) + daidrv = devm_kcalloc(dev, dai_count, sizeof(*daidrv), GFP_KERNEL); + if (!daidrv) return -ENOMEM; if (hcd->i2s) { - hcp->daidrv[i] = hdmi_i2s_dai; - hcp->daidrv[i].playback.channels_max = - hcd->max_i2s_channels; + daidrv[i] = hdmi_i2s_dai; + daidrv[i].playback.channels_max = hcd->max_i2s_channels; i++; } if (hcd->spdif) - hcp->daidrv[i] = hdmi_spdif_dai; + daidrv[i] = hdmi_spdif_dai; dev_set_drvdata(dev, hcp); - ret = devm_snd_soc_register_component(dev, &hdmi_driver, hcp->daidrv, - dai_count); + ret = devm_snd_soc_register_component(dev, &hdmi_driver, daidrv, + dai_count); if (ret) { dev_err(dev, "%s: snd_soc_register_component() failed (%d)\n", __func__, ret);