Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3578734pxb; Sat, 13 Feb 2021 02:25:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJwfGV3ugsSUc57+7xrdn3SBmbgfO6xp3zhLw/3E0WE3aonjYY4hqRJIwMFCPgnnFfF+M/Pc X-Received: by 2002:a17:906:8612:: with SMTP id o18mr6930021ejx.435.1613211914235; Sat, 13 Feb 2021 02:25:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613211914; cv=none; d=google.com; s=arc-20160816; b=jun/0zP7c7I/6DwrKb9cCrebbGkq5JO2vt0jgc+Mg3EAQiyuBz9qf8oqagMG/mZKsw aBa57TOzjCoJ+AWLFfHfBy2hlBy/NtJhKKFHFzpe9FgjSodfXcPLPy7pRiEcmlF5AlOK sMsOzrNkTiETZhRggBqtn687hvp5C00NN33IXj7cfFMRDvPBvFe26ZacboPe+6M6/AWE qj/jG9/N7XFmMPNu15j9tTNHR3Lrn+H7Lnz/KAtpsGIP6DBHce95qaJmR2nRqa17ww1h 6CbXuGf6ryB+YqqzLGs0LYCnq3sDpTQiYlthaFFfaq089UHEX9uYkMkxh0NoiWxN7KFK vZNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=IOt8ZUMx4OnKMylJ1RrSdE54PYS884MhhxOIQzf/obs=; b=elSElgqxNVk1PMG8YXJPE316YCf3xFyw/Qe/X3J/Am0rDcTlJSA6YsinvOIe60Z5VJ MvbYb9iYxIcN0I/oMoE6iZuzOHWXdvPL6vtyasNK5ACApLe90O8jTZ3XaiL42fWrIhcm VQ15eKM8ftOmh7MBXGwudIH8PcVfJeA83pjKKOncSAbkrdeucxaVXXXlZRpjASDo1Y5e D40P9wezVa7Sy2/SCh92UJBSFydKDBPAGpa9J71IThsrpBc/6+GToE/wJx68z+lRBsVP DW71oVAP42Pg1tdMYCuE2MwHM8HQxeiHJBr7MOW2b9qTRFhYQ9hacpPUz0nliqCJ33CT IV5w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w22si8119641ejv.26.2021.02.13.02.24.50; Sat, 13 Feb 2021 02:25:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229720AbhBMKUo (ORCPT + 99 others); Sat, 13 Feb 2021 05:20:44 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:43915 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229702AbhBMKUe (ORCPT ); Sat, 13 Feb 2021 05:20:34 -0500 X-IronPort-AV: E=Sophos;i="5.81,175,1610406000"; d="scan'208";a="372960478" Received: from palace.rsr.lip6.fr (HELO palace.lip6.fr) ([132.227.105.202]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 13 Feb 2021 11:19:14 +0100 From: Julia Lawall To: Liam Girdwood Cc: kernel-janitors@vger.kernel.org, Mark Brown , Jaroslav Kysela , Takashi Iwai , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] ASoC: mxs-saif: drop unneeded snd_soc_dai_set_drvdata Date: Sat, 13 Feb 2021 11:19:05 +0100 Message-Id: <20210213101907.1318496-3-Julia.Lawall@inria.fr> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210213101907.1318496-1-Julia.Lawall@inria.fr> References: <20210213101907.1318496-1-Julia.Lawall@inria.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org snd_soc_dai_set_drvdata is not needed when the set data comes from snd_soc_dai_get_drvdata or dev_get_drvdata. The problem was fixed usingthe following semantic patch: (http://coccinelle.lip6.fr/) // @@ expression x,y,e; @@ x = dev_get_drvdata(y->dev) ... when != x = e - snd_soc_dai_set_drvdata(y,x); @@ expression x,y,e; @@ x = snd_soc_dai_get_drvdata(y) ... when != x = e - snd_soc_dai_set_drvdata(y,x); // In this case, the whole probe function then does nothing, so drop it. Signed-off-by: Julia Lawall --- sound/soc/mxs/mxs-saif.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c index 07f8cf9980e3..6a2d24d48964 100644 --- a/sound/soc/mxs/mxs-saif.c +++ b/sound/soc/mxs/mxs-saif.c @@ -642,18 +642,8 @@ static const struct snd_soc_dai_ops mxs_saif_dai_ops = { .set_fmt = mxs_saif_set_dai_fmt, }; -static int mxs_saif_dai_probe(struct snd_soc_dai *dai) -{ - struct mxs_saif *saif = dev_get_drvdata(dai->dev); - - snd_soc_dai_set_drvdata(dai, saif); - - return 0; -} - static struct snd_soc_dai_driver mxs_saif_dai = { .name = "mxs-saif", - .probe = mxs_saif_dai_probe, .playback = { .channels_min = 2, .channels_max = 2,