Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp1732060imn; Sun, 31 Jul 2022 20:09:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR6lI5gTuqLTfkdVgNiZes9DkXmwobQSANqlXJvweAzxDwuiBCZtPE6EFtxAVRpno0ZZIOTH X-Received: by 2002:a17:902:ced0:b0:16d:8556:cc0e with SMTP id d16-20020a170902ced000b0016d8556cc0emr14548309plg.33.1659323356899; Sun, 31 Jul 2022 20:09:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659323356; cv=none; d=google.com; s=arc-20160816; b=Wj7NiBaw2JV9bz/2HcbGLg1Ga5QI8aeMqWKpRicMRNG5iCqJ7ReUJoG+Ar47MmaK7S JqrrTMJ70Qj7jiY6Chyl6P7Su/WIxiEC3wXCElQ5HMBevFfn6ESJgPDtkLNiLTqVlHLZ 88usLKDOm7CYH49lWqmI9N6+B3zqs3iH3BiibdPZ1W+jV0jJJRJArvG0BmNLbSO7VWII 6OaNhx2Gwz82MAXrfjHvVcqnM9roytEeB6sQbIsZo6xxAzfUwYGIUFVD8FEMhcJx7RgZ rYK9zAoj4KbE79iG9KToHFjmkn8P0nhfdpbGsVvhV/xsZBTkHi1rTGYzfqzSvbKAMfrn MiKA== 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 :feedback-id:dkim-signature:dkim-signature; bh=8BkUceWzOwh96rJjN19akdhtFgBFl98NUCkHeE2NzwA=; b=rtA4kPa4L0V1EVR3lT5tsVJJa1RRENDUkeH5Y3bdNBrV2hz+6U5dnmktiSA9gpW/Vs CCW536gkGNtCgbX29RZcdmPGHDtPdzBh19pdpSbYN2Ee98AXGR38K+SRIW3ihi8gquUv 9eG0H537ZPW3g0Y414FxTIY4yQ0jrA/mCnmkC5bztAm0xBmuelKeBXrOE/X5CUTeXcMb H2R/QxgKuwMg5xXge9Njv79OlrRoGj6JZCgfdxYP0opbOoBguhZY9reYWqDBSSCElGVJ AJV3sa9RqOybTYkC9QF/IdPNX5PMmkDlDG9levJw0/GCe/mMejM9sOQmGWEOT7vL6P6K oUIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm1 header.b=BC5vMiF1; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=ZkOGuuOn; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w185-20020a6382c2000000b0041bc14ba237si6229684pgd.744.2022.07.31.20.09.01; Sun, 31 Jul 2022 20:09:16 -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=@sholland.org header.s=fm1 header.b=BC5vMiF1; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=ZkOGuuOn; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238845AbiHADGX (ORCPT + 99 others); Sun, 31 Jul 2022 23:06:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239642AbiHADFl (ORCPT ); Sun, 31 Jul 2022 23:05:41 -0400 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29C9EDF5B; Sun, 31 Jul 2022 20:05:35 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 538CE320070D; Sun, 31 Jul 2022 23:05:34 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 31 Jul 2022 23:05:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1659323133; x=1659409533; bh=8B kUceWzOwh96rJjN19akdhtFgBFl98NUCkHeE2NzwA=; b=BC5vMiF1BXBxRjpBRE al8JabKsundk9Jx0brzO+RNg4d4XRFLuublrj4Odei2o0DCPbD6nFaJ6fAeKXHiw 4TEWhdAOHRO9HxdRrawzc3dVNq7IpHingTBu2BJVXGlTrrkolFefR8glNN3wGqEb r9L2NQ5rxZfm0sIEcb55aC+1pt27uGKYyZ5py5uurvA/gyqCzUl+XmQzb4r4rWQ8 Wj/ih/W/8jSbydpOUtJpTlyaOQzvrkDeOY/YZ5U8GnWOYx6tsJVPtTN98Y0ZfJhP qwTeRAX0RBNYfITLldGddU/3SkOmC0QvcQL0x+Ms+Lxn+B4SsTOh+B8UnPXaiLGs yhlg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1659323133; x=1659409533; bh=8BkUceWzOwh96 rJjN19akdhtFgBFl98NUCkHeE2NzwA=; b=ZkOGuuOnBgcaP45QAzwKTxvAAwT6d awM2H8aXLyevOv2vOpBiIU/hmopqlAkHATp1eJTGeUNYusEJqjn0i6bZsAMLg7ds g8tAq5fQh3hAqNWVk7b9+zIOGwfL34lKueHAoNkoeZS0pAPK7m5sZwCrd4O1zAik 12/Y+EqFjH7xOMPqCSeZMnrkG+UbgKURTouDehr7YH2objt3F0XPW6qVknP36xvi 80nsJYqQ3Ta7pSSWYQy1llmGOdtaGuN/7D9100vO1sVagbxRHIIwiD5hSXs2rSUJ SphUz/D8NzjstOhRW6rCe4qN3m2x30taS6KnoSnMj1/o0DL2+m/U0wMPg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvddvvddgheekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepufgrmhhu vghlucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecugg ftrfgrthhtvghrnhepudekteeuudehtdelteevgfduvddvjefhfedulefgudevgeeghefg udefiedtveetnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilhhfrh homhepshgrmhhuvghlsehshhholhhlrghnugdrohhrgh X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 31 Jul 2022 23:05:33 -0400 (EDT) From: Samuel Holland To: Chen-Yu Tsai , Jernej Skrabec Cc: Samuel Holland , Arnd Bergmann , Hans de Goede , Icenowy Zheng , Krzysztof Kozlowski , Maxime Ripard , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev Subject: [PATCH 7/9] soc: sunxi: sram: Save a pointer to the OF match data Date: Sun, 31 Jul 2022 22:05:07 -0500 Message-Id: <20220801030509.21966-8-samuel@sholland.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220801030509.21966-1-samuel@sholland.org> References: <20220801030509.21966-1-samuel@sholland.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, 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 It is inefficient to match the compatible string every time the regmap is accessed. Signed-off-by: Samuel Holland --- drivers/soc/sunxi/sunxi_sram.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/soc/sunxi/sunxi_sram.c b/drivers/soc/sunxi/sunxi_sram.c index 9622fd45f5e5..7c6fb17cfe7f 100644 --- a/drivers/soc/sunxi/sunxi_sram.c +++ b/drivers/soc/sunxi/sunxi_sram.c @@ -305,9 +305,7 @@ static const struct sunxi_sramc_variant sun50i_h616_sramc_variant = { static bool sunxi_sram_regmap_accessible_reg(struct device *dev, unsigned int reg) { - const struct sunxi_sramc_variant *variant; - - variant = of_device_get_match_data(dev); + const struct sunxi_sramc_variant *variant = dev_get_drvdata(dev); if (reg < SUNXI_SRAM_EMAC_CLOCK_REG) return false; @@ -340,6 +338,8 @@ static int __init sunxi_sram_probe(struct platform_device *pdev) if (!variant) return -EINVAL; + dev_set_drvdata(dev, (struct sunxi_sramc_variant *)variant); + base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(base)) return PTR_ERR(base); -- 2.35.1