From mboxrd@z Thu Jan 1 00:00:00 1970 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 E48FEC433FE for ; Wed, 30 Mar 2022 12:00:00 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 2514A18FA; Wed, 30 Mar 2022 13:59:09 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2514A18FA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1648641599; bh=IVt9jYETt3TQfguSpdnH8Vu6cSpfeaiBih9Ro8JSimM=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=nHyTdPG3nPpaYHZUryQBq7lCkz7D84FCFGpQN0/y/O/mi/ao+LouWlghDPcZyNze/ 1UB6rfA+s+27vpGooRFz9LM5lJKyEL+C2FqNCmYqdVU/lIdEHWxMpJecxDvw0GoKnG VmR542jvtqCECcYNV0i4QnoSiZ9oa/vg8Svd6Y+I= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C9926F80605; Wed, 30 Mar 2022 13:50:10 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7DD91F8060C; Wed, 30 Mar 2022 13:50:08 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1BD9BF80253 for ; Wed, 30 Mar 2022 13:50:02 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1BD9BF80253 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XzxO3X2l" 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 C54F9616DC; Wed, 30 Mar 2022 11:50:00 +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 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 Cc: Sasha Levin , alsa-devel@alsa-project.org, Zeal Robot , tiwai@suse.com, lgirdwood@gmail.com, Minghao Chi , Mark Brown X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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