From nobody Fri Dec 19 14:36:11 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76C42C83F14 for ; Mon, 28 Aug 2023 19:11:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233294AbjH1TKl (ORCPT ); Mon, 28 Aug 2023 15:10:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233298AbjH1TKb (ORCPT ); Mon, 28 Aug 2023 15:10:31 -0400 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7289EE0 for ; Mon, 28 Aug 2023 12:10:29 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.02,208,1688396400"; d="scan'208";a="174239901" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 29 Aug 2023 04:10:28 +0900 Received: from localhost.localdomain (unknown [10.226.92.234]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 92B284055156; Tue, 29 Aug 2023 04:10:25 +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, linux-kernel@vger.kernel.org, Andy Shevchenko Subject: [PATCH v2 2/2] ASoC: tlv320aic32x4-i2c: Simplify probe() Date: Mon, 28 Aug 2023 20:10:14 +0100 Message-Id: <20230828191014.138310-3-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230828191014.138310-1-biju.das.jz@bp.renesas.com> References: <20230828191014.138310-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Simplify probe() by replacing of_match_node() and i2c_match_id() with i2c_get_match_data(). Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko --- v1->v2: * Return value of i2c_get_match_data() passed to type paramemter in aic32x4_probe(). --- sound/soc/codecs/tlv320aic32x4-i2c.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/sound/soc/codecs/tlv320aic32x4-i2c.c b/sound/soc/codecs/tlv320= aic32x4-i2c.c index 713f3f63b5e3..b27b5ae1e4b2 100644 --- a/sound/soc/codecs/tlv320aic32x4-i2c.c +++ b/sound/soc/codecs/tlv320aic32x4-i2c.c @@ -16,9 +16,6 @@ =20 #include "tlv320aic32x4.h" =20 -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,18 +27,7 @@ static int aic32x4_i2c_probe(struct i2c_client *i2c) config.val_bits =3D 8; =20 regmap =3D devm_regmap_init_i2c(i2c, &config); - - if (i2c->dev.of_node) { - const struct of_device_id *oid; - - oid =3D of_match_node(aic32x4_of_id, i2c->dev.of_node); - type =3D (uintptr_t)oid->data; - } else { - const struct i2c_device_id *id; - - id =3D i2c_match_id(aic32x4_i2c_id, i2c); - type =3D id->driver_data; - } + type =3D (uintptr_t)i2c_get_match_data(i2c); =20 return aic32x4_probe(&i2c->dev, regmap, type); } --=20 2.25.1