Received: by 2002:a05:7412:3210:b0:e2:908c:2ebd with SMTP id eu16csp1133465rdb; Fri, 1 Sep 2023 14:01:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFNTYy34vwwrbks5z3nUm+wnqTqVOYdhfdQYtwlNSFmMwlToMkdnzPyZ9vaaHauFply4Vyy X-Received: by 2002:a05:6a20:12cb:b0:13d:af0e:4ee5 with SMTP id v11-20020a056a2012cb00b0013daf0e4ee5mr4705291pzg.18.1693602076625; Fri, 01 Sep 2023 14:01:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693602076; cv=none; d=google.com; s=arc-20160816; b=H2Sa4Bi66iOKO7eeEUfmzh+iyv392Jm/WvAvQZUo44yz0BSk2hRgu2jfTKI2u9iTZJ r4Usg3d4SYEPPNque8A9nFlx9iBDFgnv0X90M67lRRAncl8ROyXb455ZPNhu0jLOePw8 DWONHyrxV9lWOqLA49bLOmwi0z+PZc/4sxAfvtP4NV204C1uFcED8cEDQhrL8Jci48y4 YQZQmpPX5Gg3E7K1FVrk+5ghibPxRKZLE7zTGqKE5TjYSVW+UC4RYudrvh9aXTcg1miN QSpTbnB4kJzPAvZLaykC0JYrucNInoRru+OYgHrbteqS/SKWfyaMyMcUpXIcmjD5cwq9 3Vqg== 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=S9BTePyvjNib0mSaPdFlTZZ2eGnqI7bRkPo+50lfxHI=; fh=isro4ohP5UEoi6J58tTnBJC846N0ifuc0XKNYyi01B4=; b=E5+3O9aVChupJLJUPe2bhc5BQkYZOBcH3UfOZ7GphHWdwUSIt8cmwGGJVTR2fySr6O t7IGibJxidQszp4NGx8hPmGSeYN+VMV0dmwSBoVDEUw9lnfZEQk5TwK8adQofzL5vqGA BuwD2U8WWycTQ992XCvSeyni2s9F3X7JpCiA22HWj757JCWcuY4ZKAjxlpgk5M/wl0KH YPIPq0ezckBoNmSQICdTLRdVPxEh/1zeaqdUDtFyKFvyCrk0JDWcSWU6m6783xv1KgMa 4BLy/fo/MfgjhcpKpVFg1BVHZmmsFXmcyfL6yqDntM+XAyVOo18g5+PDWL493VfZYP5L wg0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ds6-20020a056a004ac600b006873b49ae06si3395093pfb.287.2023.09.01.13.59.29; Fri, 01 Sep 2023 14:01:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347236AbjHaTql (ORCPT + 99 others); Thu, 31 Aug 2023 15:46:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347244AbjHaTqj (ORCPT ); Thu, 31 Aug 2023 15:46:39 -0400 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 458FEE7B for ; Thu, 31 Aug 2023 12:46:36 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.02,217,1688396400"; d="scan'208";a="174632400" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 01 Sep 2023 04:46:36 +0900 Received: from localhost.localdomain (unknown [10.226.92.179]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id A3F7740078BB; Fri, 1 Sep 2023 04:46:32 +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 v3 2/3] ASoC: tlv320aic32x4-i2c: Simplify probe() Date: Thu, 31 Aug 2023 20:46:21 +0100 Message-Id: <20230831194622.87653-3-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230831194622.87653-1-biju.das.jz@bp.renesas.com> References: <20230831194622.87653-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- v2->v3: * Added Rb tag from Andy. 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/tlv320aic32x4-i2c.c index 713f3f63b5e3..b27b5ae1e4b2 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,18 +27,7 @@ static int aic32x4_i2c_probe(struct i2c_client *i2c) config.val_bits = 8; 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); - type = (uintptr_t)oid->data; - } else { - const struct i2c_device_id *id; - - id = i2c_match_id(aic32x4_i2c_id, i2c); - type = id->driver_data; - } + type = (uintptr_t)i2c_get_match_data(i2c); return aic32x4_probe(&i2c->dev, regmap, type); } -- 2.25.1