From nobody Fri Dec 19 14:38:21 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 BB993C83F37 for ; Thu, 31 Aug 2023 19:46:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347248AbjHaTqq (ORCPT ); Thu, 31 Aug 2023 15:46:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347241AbjHaTqm (ORCPT ); Thu, 31 Aug 2023 15:46:42 -0400 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 34FD2E65 for ; Thu, 31 Aug 2023 12:46:40 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.02,217,1688396400"; d="scan'208";a="174632404" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 01 Sep 2023 04:46:40 +0900 Received: from localhost.localdomain (unknown [10.226.92.179]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 9049840062C9; Fri, 1 Sep 2023 04:46:36 +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 3/3] ASoC: tlv320aic32x4-spi: Simplify probe() Date: Thu, 31 Aug 2023 20:46:22 +0100 Message-Id: <20230831194622.87653-4-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: 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 spi_get_device_id() with spi_get_device_match_data(). Signed-off-by: Biju Das --- v3: * New patch --- sound/soc/codecs/tlv320aic32x4-spi.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/sound/soc/codecs/tlv320aic32x4-spi.c b/sound/soc/codecs/tlv320= aic32x4-spi.c index 81c05030dd3b..d5976c91766e 100644 --- a/sound/soc/codecs/tlv320aic32x4-spi.c +++ b/sound/soc/codecs/tlv320aic32x4-spi.c @@ -16,8 +16,6 @@ =20 #include "tlv320aic32x4.h" =20 -static const struct of_device_id aic32x4_of_id[]; - static int aic32x4_spi_probe(struct spi_device *spi) { struct regmap *regmap; @@ -31,18 +29,7 @@ static int aic32x4_spi_probe(struct spi_device *spi) config.read_flag_mask =3D 0x01; =20 regmap =3D devm_regmap_init_spi(spi, &config); - - if (spi->dev.of_node) { - const struct of_device_id *oid; - - oid =3D of_match_node(aic32x4_of_id, spi->dev.of_node); - type =3D (uintptr_t)oid->data; - } else { - const struct spi_device_id *id_entry; - - id_entry =3D spi_get_device_id(spi); - type =3D id_entry->driver_data; - } + type =3D (uintptr_t)spi_get_device_match_data(spi); =20 return aic32x4_probe(&spi->dev, regmap, type); } --=20 2.25.1