Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3578327pxb; Sat, 13 Feb 2021 02:24:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJzm9tFDifPNRv8tPE8RIKnKw6jOtXcQXM0HdoAs8BEiDO7nOJ4Y+6+ZlFaK2gw2YfK7gDzf X-Received: by 2002:aa7:c895:: with SMTP id p21mr7233251eds.165.1613211860561; Sat, 13 Feb 2021 02:24:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613211860; cv=none; d=google.com; s=arc-20160816; b=qPPpNkiU9yyl0EBQjU8+HyZqA/fxQ2wQ3UZ+dYLlLHTF+YAmVzEgo3Mwx+LT5hULSr g5IvZhDgGSWWu3/wPSrLJmdk7S0WbjlarP5zsBnzSnvAFvQXuIp405rJ83t2bvlDragq 4gG7Zf3T5z+rc9MBt4/HaHZ1i6W4k4jfP9GDhog4Updw9cbEFuVwZujqd9o+xowa70XG GIdSfrVv0KT6LvCCEH21XDl/iCUHs13yTtMnX3/ufrcdA0L0zthT6s8fSHUn0NGCOIrO 9ufvxg5CRu+BPqg/axl7Sq7dU+ASN+0OCsmcJqSt2GZaDvlTEuS7ZOsGPGVH2HZd7NT9 Hi5w== 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=0kqTY+lndUeXoxa8mq+YDckkYnWQ6gwY8JEex1UZYvM=; b=caJJZ3JBu+TVycC5fhUw72j1MqScvCswG7X9qZr+VmPbV0NACjb5noeR9HF3n4SUk/ ZBQDGzPxcyCWBPcD7u4QzxgKNk8jiF+klsrNEGRzP89oDbumn4qlJ0vKSa7wKm8/CYQr 1e9YmZFjjar2NQj8wpFKr4O0MzA0DdzH7wwAw/xgO7UXhyFxz01mMikA5bIHn4vybrLG abnarPNk+Coqf9ek8To/U2uF4Li0rgku41CwaYmOUp2mK2rNoFIW945LliTWyQ67MmfS T27J9kUz5byxAtGyZgM8Sck9yGPUdUt/uV/gX0V9UrijohMjXGN3zxgNVICjY9vnU7Pt fYkQ== 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 c5si11266101ejd.228.2021.02.13.02.23.57; Sat, 13 Feb 2021 02:24:20 -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 S229772AbhBMKWB (ORCPT + 99 others); Sat, 13 Feb 2021 05:22:01 -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 S229475AbhBMKU6 (ORCPT ); Sat, 13 Feb 2021 05:20:58 -0500 X-IronPort-AV: E=Sophos;i="5.81,175,1610406000"; d="scan'208";a="372960480" 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: Timur Tabi Cc: kernel-janitors@vger.kernel.org, Nicolin Chen , Xiubo Li , Fabio Estevam , Shengjiu Wang , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] ASoC: fsl: drop unneeded snd_soc_dai_set_drvdata Date: Sat, 13 Feb 2021 11:19:07 +0100 Message-Id: <20210213101907.1318496-5-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); // Signed-off-by: Julia Lawall --- sound/soc/fsl/fsl_micfil.c | 2 -- sound/soc/fsl/fsl_sai.c | 2 -- sound/soc/fsl/fsl_xcvr.c | 1 - 3 files changed, 5 deletions(-) diff --git a/sound/soc/fsl/fsl_micfil.c b/sound/soc/fsl/fsl_micfil.c index 8aedf6590b28..fd21017fa2bd 100644 --- a/sound/soc/fsl/fsl_micfil.c +++ b/sound/soc/fsl/fsl_micfil.c @@ -423,8 +423,6 @@ static int fsl_micfil_dai_probe(struct snd_soc_dai *cpu_dai) return ret; } - snd_soc_dai_set_drvdata(cpu_dai, micfil); - return 0; } diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index 5e65b456d3e2..8876d0ed37d9 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -727,8 +727,6 @@ static int fsl_sai_dai_probe(struct snd_soc_dai *cpu_dai) snd_soc_dai_init_dma_data(cpu_dai, &sai->dma_params_tx, &sai->dma_params_rx); - snd_soc_dai_set_drvdata(cpu_dai, sai); - return 0; } diff --git a/sound/soc/fsl/fsl_xcvr.c b/sound/soc/fsl/fsl_xcvr.c index dd228b421e2c..8a3bde718697 100644 --- a/sound/soc/fsl/fsl_xcvr.c +++ b/sound/soc/fsl/fsl_xcvr.c @@ -869,7 +869,6 @@ static int fsl_xcvr_dai_probe(struct snd_soc_dai *dai) struct fsl_xcvr *xcvr = snd_soc_dai_get_drvdata(dai); snd_soc_dai_init_dma_data(dai, &xcvr->dma_prms_tx, &xcvr->dma_prms_rx); - snd_soc_dai_set_drvdata(dai, xcvr); snd_soc_add_dai_controls(dai, &fsl_xcvr_mode_kctl, 1); snd_soc_add_dai_controls(dai, &fsl_xcvr_arc_mode_kctl, 1);