Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5447868rwd; Wed, 24 May 2023 01:45:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5UhSCpN5+ICMss32nXFTaKFXhdnTdRhV10rOa+kULAmJMDF6AE7e1RCBBEI7Gkl0NKHc4E X-Received: by 2002:a17:902:f682:b0:1a6:db0a:8005 with SMTP id l2-20020a170902f68200b001a6db0a8005mr18893261plg.68.1684917942932; Wed, 24 May 2023 01:45:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684917942; cv=none; d=google.com; s=arc-20160816; b=gOOGQJxC+6UA2rmEiTUGI4AlFcKDLs9s8+wmH3Osug3DmNCBTjenao2tKWmNWFIX03 FfQYwaOnhG8GCoGkIF620I7yJL+LOGkbCHYWcJ+06Lc+FhpSR1ybIBRFT3wGBjUoNz1F 36yZWhG0fz9vin/dQ8HINbKvrWx70lf2pj1pbt6gPHu0UyOhMCCLS7Dg0lbLsu0UA7e4 Ph+r65eJse8wb3nc12pNkX4xTd/HNjL4yMCtDuWyfYh1o7S2JrDen8eF1s/j8xOdyjuz 5fqpsHFPDEpXuEeyCVkElMRWoMR+f0VikWhVDV/LQKX0Ke8DL9HxeIPoRrQ3heakBC30 nVFg== 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; bh=JIexx8BhclnBcHTvcCiXFlTnE2fVAa9hirfMGlbpl8g=; b=yqQU20owcGgvZoxTmTwf7UdNNvIA/v/V7+vMTxwWCC31o7c14/i835L+CnRYmEVJQ1 /0XltQLUt80EOkADq/SmTBoRHudHkG7OYLjwB3ULwmrNwy9yRcttkKfAvGfoi4T6meey ByOtWibxpS77O7zu0RDSQaWp0pv+JTBgv/ZZWHZ+KV6uLv0nmaoaeYKr4+Qwt8UujZgr 70lCAxrp4Z0ZZG2CgIb4ithWCmdhGX3dk7cty668IorWMM4UV09xTVpyIYthov4rOvot kWvlP+AgvPBGsD9oq9Lk4KHEOU643YvTTj9U/5fhsdgf48gqMOHH3DYR025e+qUam9cd bORA== ARC-Authentication-Results: i=1; mx.google.com; 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 s10-20020a170902ea0a00b001a1d987fe28si8211974plg.405.2023.05.24.01.45.30; Wed, 24 May 2023 01:45:42 -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; 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 S240375AbjEXIdk (ORCPT + 99 others); Wed, 24 May 2023 04:33:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239955AbjEXIcr (ORCPT ); Wed, 24 May 2023 04:32:47 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 142571B0 for ; Wed, 24 May 2023 01:32:36 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q1jub-0002pm-3G; Wed, 24 May 2023 10:32:01 +0200 Received: from [2a0a:edc0:0:1101:1d::28] (helo=dude02.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1q1jua-002RaP-45; Wed, 24 May 2023 10:32:00 +0200 Received: from sha by dude02.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1q1juW-009jCb-Qc; Wed, 24 May 2023 10:31:56 +0200 From: Sascha Hauer To: linux-rockchip@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Heiko Stuebner , Kyungmin Park , MyungJoo Ham , Will Deacon , Mark Rutland , kernel@pengutronix.de, Michael Riesch , Robin Murphy , Vincent Legoll , Rob Herring , Krzysztof Kozlowski , Conor Dooley , devicetree@vger.kernel.org, Sascha Hauer , Jonathan Cameron Subject: [PATCH v5 13/25] PM / devfreq: rockchip-dfi: Pass private data struct to internal functions Date: Wed, 24 May 2023 10:31:41 +0200 Message-Id: <20230524083153.2046084-14-s.hauer@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230524083153.2046084-1-s.hauer@pengutronix.de> References: <20230524083153.2046084-1-s.hauer@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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 The internal functions do not need the struct devfreq_event_dev *, so pass them the struct rockchip_dfi *. This is a preparation for adding perf support later which doesn't have a struct devfreq_event_dev *. Signed-off-by: Sascha Hauer Reviewed-by: Jonathan Cameron --- drivers/devfreq/event/rockchip-dfi.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/devfreq/event/rockchip-dfi.c b/drivers/devfreq/event/rockchip-dfi.c index 0a568c5551699..d39db5de7f19c 100644 --- a/drivers/devfreq/event/rockchip-dfi.c +++ b/drivers/devfreq/event/rockchip-dfi.c @@ -72,9 +72,8 @@ struct rockchip_dfi { unsigned int channel_mask; }; -static void rockchip_dfi_start_hardware_counter(struct devfreq_event_dev *edev) +static void rockchip_dfi_start_hardware_counter(struct rockchip_dfi *dfi) { - struct rockchip_dfi *dfi = devfreq_event_get_drvdata(edev); void __iomem *dfi_regs = dfi->regs; /* clear DDRMON_CTRL setting */ @@ -102,18 +101,16 @@ static void rockchip_dfi_start_hardware_counter(struct devfreq_event_dev *edev) dfi_regs + DDRMON_CTRL); } -static void rockchip_dfi_stop_hardware_counter(struct devfreq_event_dev *edev) +static void rockchip_dfi_stop_hardware_counter(struct rockchip_dfi *dfi) { - struct rockchip_dfi *dfi = devfreq_event_get_drvdata(edev); void __iomem *dfi_regs = dfi->regs; writel_relaxed(HIWORD_UPDATE(0, DDRMON_CTRL_SOFTWARE_EN), dfi_regs + DDRMON_CTRL); } -static void rockchip_dfi_read_counters(struct devfreq_event_dev *edev, struct dmc_count *count) +static void rockchip_dfi_read_counters(struct rockchip_dfi *dfi, struct dmc_count *count) { - struct rockchip_dfi *dfi = devfreq_event_get_drvdata(edev); u32 i; void __iomem *dfi_regs = dfi->regs; @@ -131,7 +128,7 @@ static int rockchip_dfi_disable(struct devfreq_event_dev *edev) { struct rockchip_dfi *dfi = devfreq_event_get_drvdata(edev); - rockchip_dfi_stop_hardware_counter(edev); + rockchip_dfi_stop_hardware_counter(dfi); clk_disable_unprepare(dfi->clk); return 0; @@ -148,7 +145,7 @@ static int rockchip_dfi_enable(struct devfreq_event_dev *edev) return ret; } - rockchip_dfi_start_hardware_counter(edev); + rockchip_dfi_start_hardware_counter(dfi); return 0; } @@ -166,7 +163,7 @@ static int rockchip_dfi_get_event(struct devfreq_event_dev *edev, u32 access = 0, total = 0; int i; - rockchip_dfi_read_counters(edev, &count); + rockchip_dfi_read_counters(dfi, &count); /* We can only report one channel, so find the busiest one */ for (i = 0; i < DMC_MAX_CHANNELS; i++) { -- 2.39.2