From patchwork Sun Aug 27 09:45:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 717417 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 801EBC83F01 for ; Sun, 27 Aug 2023 09:47:27 +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 2281D950; Sun, 27 Aug 2023 11:46:34 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2281D950 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1693129644; bh=RPdJpzQFzxTByvZFMN4O1z+CFu3Vg6Ca/qJOqzlO58g=; h=From:To:Cc:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=BrzR0VDovFoA69jzOipP5c2HX6hNCFYGjAcdQN7w2khDrQjf6AQKedorIwC+MRu8f xFl6Y1XxggDBkKkqPsCirpoeSlMrI8fGZQq7U1f+7VGecyKZNmyW3RPG7qL5hN9IYj zLlPWsw2wd5Ebdvh598cUk7dsVN2uRjc8qeP84IA= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4B557F8032D; Sun, 27 Aug 2023 11:46:03 +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 EC3D4F80158; Sun, 27 Aug 2023 11:46:02 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B6447F80158; Sun, 27 Aug 2023 11:45:58 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id 78559F800D1 for ; Sun, 27 Aug 2023 11:45:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 78559F800D1 X-IronPort-AV: E=Sophos;i="6.02,204,1688396400"; d="scan'208";a="177796622" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 27 Aug 2023 18:45:43 +0900 Received: from localhost.localdomain (unknown [10.226.92.26]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 8836E41AE7AD; Sun, 27 Aug 2023 18:45:38 +0900 (JST) From: Biju Das To: Shenghao Ding , Kevin Lu , Baojun Xu , Jaroslav Kysela , Takashi Iwai Cc: Biju Das , Liam Girdwood , Mark Brown , alsa-devel@alsa-project.org, Geert Uytterhoeven , Andy Shevchenko , Prabhakar Mahadev Lad , linux-renesas-soc@vger.kernel.org Subject: [PATCH] ASoC: tlv320aic32x4-i2c: Simplify probe() Date: Sun, 27 Aug 2023 10:45:36 +0100 Message-Id: <20230827094536.49511-1-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Message-ID-Hash: DJ3YWT3TVXSAINC54Z7JFCNZ3ZTWOLG5 X-Message-ID-Hash: DJ3YWT3TVXSAINC54Z7JFCNZ3ZTWOLG5 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_node() and i2c_match_id() with i2c_get_match_data(). Signed-off-by: Biju Das --- Note: This patch is only compile tested. --- sound/soc/codecs/tlv320aic32x4-i2c.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/sound/soc/codecs/tlv320aic32x4-i2c.c b/sound/soc/codecs/tlv320aic32x4-i2c.c index 49b33a256cd7..513f257818ca 100644 --- a/sound/soc/codecs/tlv320aic32x4-i2c.c +++ b/sound/soc/codecs/tlv320aic32x4-i2c.c @@ -16,9 +16,6 @@ #include "tlv320aic32x4.h" -static const struct of_device_id aic32x4_of_id[]; -static const struct i2c_device_id aic32x4_i2c_id[]; - static int aic32x4_i2c_probe(struct i2c_client *i2c) { struct regmap *regmap; @@ -30,17 +27,7 @@ static int aic32x4_i2c_probe(struct i2c_client *i2c) regmap = devm_regmap_init_i2c(i2c, &config); - if (i2c->dev.of_node) { - const struct of_device_id *oid; - - oid = of_match_node(aic32x4_of_id, i2c->dev.of_node); - dev_set_drvdata(&i2c->dev, (void *)oid->data); - } else { - const struct i2c_device_id *id; - - id = i2c_match_id(aic32x4_i2c_id, i2c); - dev_set_drvdata(&i2c->dev, (void *)id->driver_data); - } + dev_set_drvdata(&i2c->dev, (void *)i2c_get_match_data(i2c)); return aic32x4_probe(&i2c->dev, regmap); }