Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp1001067rdb; Sun, 3 Sep 2023 22:31:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEufYYEv0D/Bl0LlSGjCcb4Zvxkd4++1SdCtX9+eh0GFjsCYdqx3wCFYq4SbVLQCBZKQXBq X-Received: by 2002:a17:907:78da:b0:9a1:c659:7c5c with SMTP id kv26-20020a17090778da00b009a1c6597c5cmr6725449ejc.18.1693805514415; Sun, 03 Sep 2023 22:31:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693805514; cv=none; d=google.com; s=arc-20160816; b=eADZHqtdCoDg8vdgW2RSsuTyiI0VKTYZNTmsTn1RkymgmYMlT/eHH+LfngX4Eyz0FO tpPFh/9GrsFM9gMsU/Wb27JVk9GO0rSZAORyHCOzdGhTo9KHP5/rPBHoBfIn1FBaqVZo 9VwBCn5pP5hUi+efgXbHz3vTOYu55HdTcUXAt0SjX/y7NDRaRRyuZROmaUDIrOSbmXGL JfjEJCzC3GaR6VEidoUMEQLRpW1762Q9PVEO0BFUllxaEvKju6UdzC3P//6sFC6Fy6T2 lykDBZUXjGC9Zir75mYLGjWABQ6pwQ9M5HC4JEDIk3+EnyiggAf+fnntZDyhHGKjXGA+ DUTg== 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=k9jaatNnh5wZv68+mq58dIKln/L520v8eJnvxDhv/1E=; fh=isro4ohP5UEoi6J58tTnBJC846N0ifuc0XKNYyi01B4=; b=avRqu4FxmvbG4TdwJXulk5HifVL4iBU4fJO0dQ4Yqxy11DzMIeS87Lox0dKtA8yNs/ qcKHKGy3NAR5oOaue8KVZXFkpNsci0+P7/NDyseQ12duS3oGlnHu/55OTelevNYlgo6b R2YTwASxFKbX4dMkWNOwXmZBXKdrogtEmZ6lsR3WXtHWumDG+sU7f7UszHx91nTRdcM6 h091ddc0F0On2WXIDnYuoPVdMSSw0f5jS7pN4BYlSsrV0khaTcAoVZ0KDEycd/OqRJ9Q jOdqyH8wXpvuGg8i3f+ddc/cVaZT3bItwyCXWLrS2TKqFg0K+6MAkGLPohMYBT9bp/rn 4IYQ== 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 v8-20020a170906b00800b0099caf27e61fsi5562265ejy.244.2023.09.03.22.31.26; Sun, 03 Sep 2023 22:31:54 -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 S1347242AbjHaTqq (ORCPT + 99 others); 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: 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 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); } -- 2.25.1