From patchwork Sun Aug 27 09:15:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13366884 X-Patchwork-Delegate: kieran@bingham.xyz 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 D15FCC83F01 for ; Sun, 27 Aug 2023 09:16:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230055AbjH0JP7 (ORCPT ); Sun, 27 Aug 2023 05:15:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230402AbjH0JPf (ORCPT ); Sun, 27 Aug 2023 05:15:35 -0400 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 885F3D8 for ; Sun, 27 Aug 2023 02:15:32 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.02,204,1688396400"; d="scan'208";a="177795749" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 27 Aug 2023 18:15:31 +0900 Received: from localhost.localdomain (unknown [10.226.92.26]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id B68AB41A6E4A; Sun, 27 Aug 2023 18:15:27 +0900 (JST) From: Biju Das To: Jaroslav Kysela , Takashi Iwai Cc: Biju Das , Kevin Cernekee , Liam Girdwood , Mark Brown , Kamel Bouhara , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , alsa-devel@alsa-project.org, Geert Uytterhoeven , Andy Shevchenko , Prabhakar Mahadev Lad , linux-renesas-soc@vger.kernel.org Subject: [PATCH] ASoC: tas571x: Simplify probe() Date: Sun, 27 Aug 2023 10:15:25 +0100 Message-Id: <20230827091525.39263-1-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Simplify probe() by replacing of_match_device->i2c_get_match_data(). Signed-off-by: Biju Das --- Note: This patch is only compile tested. --- sound/soc/codecs/tas571x.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/sound/soc/codecs/tas571x.c b/sound/soc/codecs/tas571x.c index 1756edb35961..a220342c3d77 100644 --- a/sound/soc/codecs/tas571x.c +++ b/sound/soc/codecs/tas571x.c @@ -829,14 +829,10 @@ static struct snd_soc_dai_driver tas571x_dai = { .ops = &tas571x_dai_ops, }; -static const struct of_device_id tas571x_of_match[] __maybe_unused; -static const struct i2c_device_id tas571x_i2c_id[]; - static int tas571x_i2c_probe(struct i2c_client *client) { struct tas571x_private *priv; struct device *dev = &client->dev; - const struct of_device_id *of_id; int i, ret; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); @@ -844,14 +840,7 @@ static int tas571x_i2c_probe(struct i2c_client *client) return -ENOMEM; i2c_set_clientdata(client, priv); - of_id = of_match_device(tas571x_of_match, dev); - if (of_id) - priv->chip = of_id->data; - else { - const struct i2c_device_id *id = - i2c_match_id(tas571x_i2c_id, client); - priv->chip = (void *) id->driver_data; - } + priv->chip = i2c_get_match_data(client); priv->mclk = devm_clk_get(dev, "mclk"); if (IS_ERR(priv->mclk) && PTR_ERR(priv->mclk) != -ENOENT) {