Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp15651pxb; Wed, 30 Mar 2022 21:32:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzw+JTACe8Y7VNCuBvG8n42j17hZBi7rQjIKCwU+AdFwqV8r1n9G9+l+w0wstafG8rzqBh X-Received: by 2002:a62:6403:0:b0:4fa:c74c:83c5 with SMTP id y3-20020a626403000000b004fac74c83c5mr3303547pfb.30.1648701135693; Wed, 30 Mar 2022 21:32:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648701135; cv=none; d=google.com; s=arc-20160816; b=pddxtta5nkAQZLUMWhH2KrFudvzhXZLGW3RONTO3c/dbRkR+5pTVmTMRys4PwArtig l2hTcR+yTabBWI096jg043jgm4GLKZlnSoZXStBfyewCub6momv3VOu4oOQGX7sCfjX6 g4kcKEIitsLubFk3tkXDktm09E8DklMlTI3R4I70OApvctol+VCvGezik8nw9fV/VRIr s6DEfk1WrbBdlCMigMwv5il81dIqCHIi5EnSG8Xucima4pgVMrAt/v+qocbFEIGZuGN2 NP1SzAshKiwBMkWNSSOy2lnQ5B3RqZrWGqC+mZcQMOuqAuytl+fI/ZNTJjkUpYp62BSo 9R1g== 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 :dkim-signature; bh=XfkUolKJ7cJxmNpSXap4oEPu5lvCPansSpNVo9baSHY=; b=WN/db5XbqLAre8HKkG8jcH76GcFszgeE69DOM43tkeAZVhVnk+jAa/Yrl1ILI70n7C 0fwyYu1Egs8f9tuc8+ZVy6hNvMNGk/BZybltjOYBpyQaOtaBNFL2nym7IqaJleBG/WpG McF3vtr2YgnSW6U6wTaL4ux2Ak8IVcKYBl9tvQ5sM1TnvKDEPEIDb8tzzdV5S5LTvd96 4YonP8ATddn7xiNwr2qeYTxPo4598yk4wgwlrFv4OWbDrQOshWb7ktlu/3S6bUrKgC18 sRI/8HJYYFNMo/UxfOb3lvJ5sw0vAZSCMS5cSmN2qsPWxELw+5IIcqCZozHYw/Us+7OY G+Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XzxO3X2l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id q18-20020a170902dad200b00153b2d16486si26511566plx.142.2022.03.30.21.32.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 21:32:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XzxO3X2l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 806BD1DA8E9; Wed, 30 Mar 2022 20:25:13 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237892AbiC3MCj (ORCPT + 99 others); Wed, 30 Mar 2022 08:02:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344926AbiC3Lxq (ORCPT ); Wed, 30 Mar 2022 07:53:46 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60090274292; Wed, 30 Mar 2022 04:50:04 -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 ams.source.kernel.org (Postfix) with ESMTPS id DC84BB81C23; Wed, 30 Mar 2022 11:50:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8487CC340F2; Wed, 30 Mar 2022 11:49:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648641000; bh=IVt9jYETt3TQfguSpdnH8Vu6cSpfeaiBih9Ro8JSimM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XzxO3X2lWsmhu5zE/UIdGAH8RbKpNLefGucKCN5H4okNiWDzPOxDan5NVdBaNU2NR rDHMd+0MqHypel6b/JAourRTbRNjHOth4Y7MeEKzqY9dIbS0O1b6S+yq2yGcre/s+n SADrvMGUip1Me3zgqzT1GVYZquGLWk7AP1fUZYLxEMFAaqiyCZKwM4bjvSZFsKex44 ssNct8Zn0BCprwi+u+kmkYzrQBFSjTmHxEIVTMryxXK5UV3FMTb+Q5TiQ0DLg7l4/7 sDA2j6ZZ+RlNTiBIw9G70jxLPmKiBHAfZluisNHJ0lCQwJhJohscQ7AadBFLG8b3+9 8fhm23TofbGjg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Minghao Chi , Zeal Robot , Mark Brown , Sasha Levin , lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org Subject: [PATCH AUTOSEL 5.16 57/59] ASoC: ak4642: Use of_device_get_match_data() Date: Wed, 30 Mar 2022 07:48:29 -0400 Message-Id: <20220330114831.1670235-57-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220330114831.1670235-1-sashal@kernel.org> References: <20220330114831.1670235-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: Minghao Chi [ Upstream commit 835ca59799f5c60b4b54bdc7aa785c99552f63e4 ] Use of_device_get_match_data() to simplify the code. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220315023226.2118354-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/ak4613.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/sound/soc/codecs/ak4613.c b/sound/soc/codecs/ak4613.c index 4d2e78101f28..034195c83bd7 100644 --- a/sound/soc/codecs/ak4613.c +++ b/sound/soc/codecs/ak4613.c @@ -653,15 +653,10 @@ static int ak4613_i2c_probe(struct i2c_client *i2c, struct ak4613_priv *priv; regmap_cfg = NULL; - if (np) { - const struct of_device_id *of_id; - - of_id = of_match_device(ak4613_of_match, dev); - if (of_id) - regmap_cfg = of_id->data; - } else { + if (np) + regmap_cfg = of_device_get_match_data(dev); + else regmap_cfg = (const struct regmap_config *)id->driver_data; - } if (!regmap_cfg) return -EINVAL; -- 2.34.1