From patchwork Tue Oct 3 16:43:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 730358 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6743AE7C4F5 for ; Thu, 5 Oct 2023 07:52:56 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id BBD45EAB; Thu, 5 Oct 2023 09:52:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BBD45EAB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1696492374; bh=4rrnrq07QQ7mg3jVhwP3uG1o5PbTor7aJsxbpbknuWQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=MqtiIWeTQzFUuYEgmimmXHzJO8Mjz/zZZoq5rhDW6UBXt695k0+6A5CE7rA7cWodL gJs3hbO4AYu5rI/vqQti2ZcjbeQCiml17zCZwkKCXYFkrIcLsrte1ay9UjRzdSxC2M ipCHhLrGNUqAsdweRxvL7lUVqsQsRy3I9uxJvO/Y= Received: by alsa1.perex.cz (Postfix, from userid 50401) id A68DAF805E0; Thu, 5 Oct 2023 09:50:28 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 2EAB7F805D9; Thu, 5 Oct 2023 09:50:28 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4BF9AF8047D; Tue, 3 Oct 2023 18:44:22 +0200 (CEST) Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 80F81F80551 for ; Tue, 3 Oct 2023 18:44:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 80F81F80551 Authentication-Results: alsa1.perex.cz; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=O8spIlXW Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 8B818B81B1A; Tue, 3 Oct 2023 16:44:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5921C433C7; Tue, 3 Oct 2023 16:44:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696351448; bh=4rrnrq07QQ7mg3jVhwP3uG1o5PbTor7aJsxbpbknuWQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=O8spIlXWkzl4liaZdSq7cgvDLyssraN6LGu+LotDYpVXG25fSXPtypRduBz5CcwhO qdYogJypcRDBH5NS1x/FjUb6QKXmWK2ekXbGj+EE2wqSjoPdEySk6SZD1U8I3jqWws T+iIb87PKXcB28CV1yguvYPyOgJqyj0gurLSAU6MrV89cqk6AUtfXr+Agf9LdL8HOL iPLnlqAO1SYjEKldeLux5a9221uj/NxTWph4HuIBnZy5fuIkOY84CGHlRD+FVvMY5U 12HlXP+75zVS6SWgoch5l5bg6efntcVm3S/QEE+psfrFQmoYiu8Stb7tU7+lRB/SDC FhOOSTYlVdFyA== Received: (nullmailer pid 783961 invoked by uid 1000); Tue, 03 Oct 2023 16:43:40 -0000 From: Rob Herring Date: Tue, 03 Oct 2023 11:43:08 -0500 Subject: [PATCH 2/5] ASoC: Drop unnecessary of_match_device() calls MIME-Version: 1.0 Message-Id: <20231003-dt-asoc-header-cleanups-v1-2-308666806378@kernel.org> References: <20231003-dt-asoc-header-cleanups-v1-0-308666806378@kernel.org> In-Reply-To: <20231003-dt-asoc-header-cleanups-v1-0-308666806378@kernel.org> To: Claudiu Beznea , Mark Brown , Jaroslav Kysela , Takashi Iwai , Nicolas Ferre , Alexandre Belloni , Peter Rosin , Ray Jui , Scott Branden , Lars-Peter Clausen , =?utf-8?q?Nuno_S=C3=A1?= , James Schulman , David Rhodes , Richard Fitzgerald , Support Opensource , Matthias Brugger , AngeloGioacchino Del Regno , Shenghao Ding , Kevin Lu , Baojun Xu , Oder Chiou , Fabio Estevam , Kiseok Jo , Kevin Cernekee , Shengjiu Wang , Xiubo Li , Nicolin Chen , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , NXP Linux Team , Srinivas Kandagatla , Banajit Goswami , Nicolas Frattaroli , Heiko Stuebner , Sylwester Nawrocki , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Ban Tao , Thierry Reding , Jonathan Hunter , Peter Ujfalusi , Jarkko Nikula , Cezary Rojewski , Pierre-Louis Bossart , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Olivier Moysan , Arnaud Pouliquen , Maxime Coquelin , Alexandre Torgue Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com, linuxppc-dev@lists.ozlabs.org X-Mailer: b4 0.13-dev X-MailFrom: robh@kernel.org X-Mailman-Rule-Hits: max-recipients X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-size; news-moderation; no-subject; digests; suspicious-header Message-ID-Hash: EXPGO6JJ3FE7DCN6FLDAHU7OWCS2XEQW X-Message-ID-Hash: EXPGO6JJ3FE7DCN6FLDAHU7OWCS2XEQW X-Mailman-Approved-At: Thu, 05 Oct 2023 07:50:02 +0000 X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: <> List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: If probe is reached, we've already matched the device and in the case of DT matching, the struct device_node pointer will be set. Therefore, there is no need to call of_match_device() in probe. Signed-off-by: Rob Herring --- sound/soc/codecs/ak5386.c | 7 ++----- sound/soc/codecs/cs4271.c | 22 ++++++---------------- sound/soc/codecs/tas5086.c | 6 +----- 3 files changed, 9 insertions(+), 26 deletions(-) diff --git a/sound/soc/codecs/ak5386.c b/sound/soc/codecs/ak5386.c index 0c5e00679c7d..21a44476f48d 100644 --- a/sound/soc/codecs/ak5386.c +++ b/sound/soc/codecs/ak5386.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -168,7 +167,6 @@ static int ak5386_probe(struct platform_device *pdev) if (!priv) return -ENOMEM; - priv->reset_gpio = -EINVAL; dev_set_drvdata(dev, priv); for (i = 0; i < ARRAY_SIZE(supply_names); i++) @@ -179,9 +177,8 @@ static int ak5386_probe(struct platform_device *pdev) if (ret < 0) return ret; - if (of_match_device(of_match_ptr(ak5386_dt_ids), dev)) - priv->reset_gpio = of_get_named_gpio(dev->of_node, - "reset-gpio", 0); + priv->reset_gpio = of_get_named_gpio(dev->of_node, + "reset-gpio", 0); if (gpio_is_valid(priv->reset_gpio)) if (devm_gpio_request_one(dev, priv->reset_gpio, diff --git a/sound/soc/codecs/cs4271.c b/sound/soc/codecs/cs4271.c index 188b8b43c524..9e6f8a048dd5 100644 --- a/sound/soc/codecs/cs4271.c +++ b/sound/soc/codecs/cs4271.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -563,19 +562,12 @@ static int cs4271_component_probe(struct snd_soc_component *component) struct cs4271_private *cs4271 = snd_soc_component_get_drvdata(component); struct cs4271_platform_data *cs4271plat = component->dev->platform_data; int ret; - bool amutec_eq_bmutec = false; + bool amutec_eq_bmutec; -#ifdef CONFIG_OF - if (of_match_device(cs4271_dt_ids, component->dev)) { - if (of_get_property(component->dev->of_node, - "cirrus,amutec-eq-bmutec", NULL)) - amutec_eq_bmutec = true; - - if (of_get_property(component->dev->of_node, - "cirrus,enable-soft-reset", NULL)) - cs4271->enable_soft_reset = true; - } -#endif + amutec_eq_bmutec = of_property_read_bool(component->dev->of_node, + "cirrus,amutec-eq-bmutec"); + cs4271->enable_soft_reset = of_property_read_bool(component->dev->of_node, + "cirrus,enable-soft-reset"); ret = regulator_bulk_enable(ARRAY_SIZE(cs4271->supplies), cs4271->supplies); @@ -655,9 +647,7 @@ static int cs4271_common_probe(struct device *dev, if (!cs4271) return -ENOMEM; - if (of_match_device(cs4271_dt_ids, dev)) - cs4271->gpio_nreset = - of_get_named_gpio(dev->of_node, "reset-gpio", 0); + cs4271->gpio_nreset = of_get_named_gpio(dev->of_node, "reset-gpio", 0); if (cs4271plat) cs4271->gpio_nreset = cs4271plat->gpio_nreset; diff --git a/sound/soc/codecs/tas5086.c b/sound/soc/codecs/tas5086.c index 60e59e993ba6..f52c14b43f28 100644 --- a/sound/soc/codecs/tas5086.c +++ b/sound/soc/codecs/tas5086.c @@ -940,11 +940,7 @@ static int tas5086_i2c_probe(struct i2c_client *i2c) i2c_set_clientdata(i2c, priv); - if (of_match_device(of_match_ptr(tas5086_dt_ids), dev)) { - struct device_node *of_node = dev->of_node; - gpio_nreset = of_get_named_gpio(of_node, "reset-gpio", 0); - } - + gpio_nreset = of_get_named_gpio(dev->of_node, "reset-gpio", 0); if (gpio_is_valid(gpio_nreset)) if (devm_gpio_request(dev, gpio_nreset, "TAS5086 Reset")) gpio_nreset = -EINVAL;