Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp665985pxb; Tue, 5 Apr 2022 17:57:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJ/JaZPCZcwWPHpWrdgfc3ao1JoGtfhx5frxLTsUSJyBuWbr1n+J6SJc5vlDggCXuNEe3x X-Received: by 2002:a17:902:ec89:b0:153:f480:5089 with SMTP id x9-20020a170902ec8900b00153f4805089mr6035066plg.166.1649206652730; Tue, 05 Apr 2022 17:57:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649206652; cv=none; d=google.com; s=arc-20160816; b=ryUOjMUfHE3B7NE9Bs7Vp2NGOw4J4Qjm+aWcCKuI28naYwljRYELy/e6pGMjs1bjDm J2Z/LQktGrdWLT7V7j/bEys0GPzvqS/Oxq3ydSGtOCYU9qFZ57mmHsUXLPrcg6vs7p1H B0IF6tNYRBx/K1S0XVfIcNS1+BgtI378a7rzCgLTtM48crXyu3Go1HORuncPKKJD1oyu MOIqWAtbMEn1GJ5lY5gOKINLoQ74KOLBs5FZGDQXakEF6nfHNTwGNxe32DH3XVOEDqd+ xaX8aH7ZkDpdfzIP4TRWxE0trNPD15UEoybS5yfOMW1cPIsVIXMyMNsC1gUFbxVwLUjc WQ3w== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TE5zXN2eYgCj7PHLK7sXivlei56+VqcP39xY/G0YB8w=; b=i0/mH3XGZPSAeMjI5vgrv+bz10paGDgO/mu0YkmNfUDToCQINkh4JSNvGXsZQb2DM9 GTuy1qtT6UDJ1965vP4Hjqv7SBVVrXgcE3OgGhHYjIyq8ukRPnKd80hJ5jl5xrauMc6n xcZqSshCgrsymSYHOR2aLXj0CziG1jhAIqTJ4p2aNwKobRx1P32a+UqS7eRi74IGOq1D Y5+2HXfrbUZW19zWUEx48lolQSNsJvuoN3J5O47n8YtLes4jEnam6j4hLvqbg+2srb4b AuZYdmBaueDPLgO3SX44fTp1DEq6sSm0TGR8LuKzG9vN8BUkkiE8TpC1XIoEQo93O2uD wy/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=D7lOEZ2Y; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bg28-20020a056a02011c00b00399460d1d2csi4940857pgb.754.2022.04.05.17.57.15; Tue, 05 Apr 2022 17:57:32 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=D7lOEZ2Y; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356052AbiDEMUH (ORCPT + 99 others); Tue, 5 Apr 2022 08:20:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244984AbiDEIw5 (ORCPT ); Tue, 5 Apr 2022 04:52:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EDA8E0F6; Tue, 5 Apr 2022 01:48:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2B377614F9; Tue, 5 Apr 2022 08:48:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E272C385A0; Tue, 5 Apr 2022 08:48:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649148512; bh=5Hg19Sf4g8LcZB1PsHOkiazYrJEl4v16h4W0vZCs8H8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D7lOEZ2Yj7O7spmBanUyDu6VeaBUV1clkT7JYnzfM2CK1lhbynA+47L57eD4iLHI+ DY3CL3wrqIEFfm36/gmjG5oIwkB4uWJ6PD7b6xumE+kuS4Oeh6Et06yUf+d6BhrJqE IwQlheuUkk7eQ4f4gpytmDcEqY0Q06NAwI8bcPg4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tzung-Bi Shih , Mark Brown , Sasha Levin Subject: [PATCH 5.16 0381/1017] ASoC: mediatek: use of_device_get_match_data() Date: Tue, 5 Apr 2022 09:21:34 +0200 Message-Id: <20220405070405.595516791@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Tzung-Bi Shih [ Upstream commit 3667a037e50a31555276a7989435126e501f0f15 ] Uses of_device_get_match_data() helper to clean some boilerplate code. Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20211227062153.3887447-1-tzungbi@google.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c | 7 ++----- sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c | 7 ++----- sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c | 7 ++----- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c b/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c index bda103211e0b..0ab8b050b305 100644 --- a/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c +++ b/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c @@ -685,7 +685,6 @@ static int mt8183_da7219_max98357_dev_probe(struct platform_device *pdev) struct snd_soc_dai_link *dai_link; struct mt8183_da7219_max98357_priv *priv; struct pinctrl *pinctrl; - const struct of_device_id *match; int ret, i; platform_node = of_parse_phandle(pdev->dev.of_node, @@ -695,11 +694,9 @@ static int mt8183_da7219_max98357_dev_probe(struct platform_device *pdev) return -EINVAL; } - match = of_match_device(pdev->dev.driver->of_match_table, &pdev->dev); - if (!match || !match->data) + card = (struct snd_soc_card *)of_device_get_match_data(&pdev->dev); + if (!card) return -EINVAL; - - card = (struct snd_soc_card *)match->data; card->dev = &pdev->dev; hdmi_codec = of_parse_phandle(pdev->dev.of_node, diff --git a/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c b/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c index 9f0bf15fe465..8c81c5528f6e 100644 --- a/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c +++ b/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c @@ -637,7 +637,6 @@ mt8183_mt6358_ts3a227_max98357_dev_probe(struct platform_device *pdev) struct device_node *platform_node, *ec_codec, *hdmi_codec; struct snd_soc_dai_link *dai_link; struct mt8183_mt6358_ts3a227_max98357_priv *priv; - const struct of_device_id *match; int ret, i; platform_node = of_parse_phandle(pdev->dev.of_node, @@ -647,11 +646,9 @@ mt8183_mt6358_ts3a227_max98357_dev_probe(struct platform_device *pdev) return -EINVAL; } - match = of_match_device(pdev->dev.driver->of_match_table, &pdev->dev); - if (!match || !match->data) + card = (struct snd_soc_card *)of_device_get_match_data(&pdev->dev); + if (!card) return -EINVAL; - - card = (struct snd_soc_card *)match->data; card->dev = &pdev->dev; ec_codec = of_parse_phandle(pdev->dev.of_node, "mediatek,ec-codec", 0); diff --git a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c index 24a5d0adec1b..ab449d0e4e9b 100644 --- a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c +++ b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c @@ -1106,7 +1106,6 @@ static int mt8192_mt6359_dev_probe(struct platform_device *pdev) struct device_node *platform_node, *hdmi_codec; int ret, i; struct snd_soc_dai_link *dai_link; - const struct of_device_id *match; struct mt8192_mt6359_priv *priv; platform_node = of_parse_phandle(pdev->dev.of_node, @@ -1116,11 +1115,9 @@ static int mt8192_mt6359_dev_probe(struct platform_device *pdev) return -EINVAL; } - match = of_match_device(pdev->dev.driver->of_match_table, &pdev->dev); - if (!match || !match->data) + card = (struct snd_soc_card *)of_device_get_match_data(&pdev->dev); + if (!card) return -EINVAL; - - card = (struct snd_soc_card *)match->data; card->dev = &pdev->dev; hdmi_codec = of_parse_phandle(pdev->dev.of_node, -- 2.34.1