From patchwork Sun Aug 27 09:15:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13366885 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 67ACFC83F01 for ; Sun, 27 Aug 2023 09:18:12 +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 75E9EAE8; Sun, 27 Aug 2023 11:17:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 75E9EAE8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1693127889; bh=OtHByik3G6qnXcXGFERBplwh5xo2Ok4HwC462V02hno=; h=From:To:Cc:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=qy4+EqjnRUxawAA7ojXh/qCdzxigmEjr0WbfDDiBl75x9WqD/7ZTVskIJJYhypyCZ 8cYeHiuamU1HCSP3bneYPB/AmnFtFTxsUXy0Wt5hD/7Knik13wLq0YRz2BwM9WPvWT Z4dZ3EGbJ4hsECkULTuiXuPJECRT51jEbPF+eXNY= Received: by alsa1.perex.cz (Postfix, from userid 50401) id AE5DFF80249; Sun, 27 Aug 2023 11:16:50 +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 3CC16F80158; Sun, 27 Aug 2023 11:16:50 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D5F6DF80158; Sun, 27 Aug 2023 11:15:48 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id BEFB4F800D1 for ; Sun, 27 Aug 2023 11:15:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BEFB4F800D1 X-IronPort-AV: E=Sophos;i="6.02,204,1688396400"; d="scan'208";a="177795749" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 27 Aug 2023 18:15:31 +0900 Received: from localhost.localdomain (unknown [10.226.92.26]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id B68AB41A6E4A; Sun, 27 Aug 2023 18:15:27 +0900 (JST) From: Biju Das To: Jaroslav Kysela , Takashi Iwai Cc: Biju Das , Kevin Cernekee , Liam Girdwood , Mark Brown , Kamel Bouhara , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , alsa-devel@alsa-project.org, Geert Uytterhoeven , Andy Shevchenko , Prabhakar Mahadev Lad , linux-renesas-soc@vger.kernel.org Subject: [PATCH] ASoC: tas571x: Simplify probe() Date: Sun, 27 Aug 2023 10:15:25 +0100 Message-Id: <20230827091525.39263-1-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Message-ID-Hash: UHHGOSKUEEYEIMEMY26CHOGX4CW2NIYQ X-Message-ID-Hash: UHHGOSKUEEYEIMEMY26CHOGX4CW2NIYQ X-MailFrom: biju.das.jz@bp.renesas.com 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-recipients; max-size; news-moderation; no-subject; digests; suspicious-header 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: Simplify probe() by replacing of_match_device->i2c_get_match_data(). Signed-off-by: Biju Das --- Note: This patch is only compile tested. --- sound/soc/codecs/tas571x.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/sound/soc/codecs/tas571x.c b/sound/soc/codecs/tas571x.c index 1756edb35961..a220342c3d77 100644 --- a/sound/soc/codecs/tas571x.c +++ b/sound/soc/codecs/tas571x.c @@ -829,14 +829,10 @@ static struct snd_soc_dai_driver tas571x_dai = { .ops = &tas571x_dai_ops, }; -static const struct of_device_id tas571x_of_match[] __maybe_unused; -static const struct i2c_device_id tas571x_i2c_id[]; - static int tas571x_i2c_probe(struct i2c_client *client) { struct tas571x_private *priv; struct device *dev = &client->dev; - const struct of_device_id *of_id; int i, ret; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); @@ -844,14 +840,7 @@ static int tas571x_i2c_probe(struct i2c_client *client) return -ENOMEM; i2c_set_clientdata(client, priv); - of_id = of_match_device(tas571x_of_match, dev); - if (of_id) - priv->chip = of_id->data; - else { - const struct i2c_device_id *id = - i2c_match_id(tas571x_i2c_id, client); - priv->chip = (void *) id->driver_data; - } + priv->chip = i2c_get_match_data(client); priv->mclk = devm_clk_get(dev, "mclk"); if (IS_ERR(priv->mclk) && PTR_ERR(priv->mclk) != -ENOENT) {