From patchwork Thu Aug 31 19:46:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13371836 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 8CFBEC83F37 for ; Thu, 31 Aug 2023 19:48:47 +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 C5CD4A4D; Thu, 31 Aug 2023 21:47:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C5CD4A4D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1693511320; bh=FxhNoe0Tpn2SBaEwwnW0TRYgeR47ej+MkIgjxiUC2t8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=lYv4sllj/h6kDZ8+6WQu3l+7+16vOFeJokIbv/dsNqcZkaT7bjjfGOT0IJgaAdnD3 BMDNwo8esa2GlPhgGTvF+qAs4i3aKxIUHbf+fybdAFmxIQAmQ5Kg+mcus6yv1ijev8 9VwMJptuilu2x9kGf86gIq5Kc93TqLGWe1vFjLzo= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 88A98F8057A; Thu, 31 Aug 2023 21:46:49 +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 EDD57F8057A; Thu, 31 Aug 2023 21:46:48 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id DD738F8023B; Thu, 31 Aug 2023 21:46:44 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id 28655F8023B for ; Thu, 31 Aug 2023 21:46:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 28655F8023B 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 Message-ID-Hash: 7QPJ4IOMLSEHWJJCCPB6AQG443FBQNJK X-Message-ID-Hash: 7QPJ4IOMLSEHWJJCCPB6AQG443FBQNJK 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 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/tlv320aic32x4-spi.c index 81c05030dd3b..d5976c91766e 100644 --- a/sound/soc/codecs/tlv320aic32x4-spi.c +++ b/sound/soc/codecs/tlv320aic32x4-spi.c @@ -16,8 +16,6 @@ #include "tlv320aic32x4.h" -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 = 0x01; regmap = devm_regmap_init_spi(spi, &config); - - if (spi->dev.of_node) { - const struct of_device_id *oid; - - oid = of_match_node(aic32x4_of_id, spi->dev.of_node); - type = (uintptr_t)oid->data; - } else { - const struct spi_device_id *id_entry; - - id_entry = spi_get_device_id(spi); - type = id_entry->driver_data; - } + type = (uintptr_t)spi_get_device_match_data(spi); return aic32x4_probe(&spi->dev, regmap, type); }