Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3600018rdg; Tue, 17 Oct 2023 23:19:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG7fFPG25/t1DU8wJ6r+UxuQvBYFO84/LarqlHgmJe70igVXv+AhmloaA+CDs1yDnZ63OR8 X-Received: by 2002:a05:6a00:148e:b0:6b2:5b5:4f12 with SMTP id v14-20020a056a00148e00b006b205b54f12mr4484911pfu.14.1697609970019; Tue, 17 Oct 2023 23:19:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697609969; cv=none; d=google.com; s=arc-20160816; b=U/4bGtowgxdXUhRhKRzdqCO7XRa/lvUApIDv5b1y8/Dtq7WDHy0BF8Yg6qpf1wEIwv roSmAl23zL61rYXIlzsvSxaO5Z9Q+ceBL/NmICxzInmwS8ozc8SMS12eHAtHSi0RoJWu fhp1C3mQHOoLfGQQfBcnt6j2P9S8rlWghcRJUGGi+f0nBOPnFm/4hgeceJf2B8UsR9j3 8h8JUZRNDgn8ZtO4W5CabS7pq7hk42etWiabzPW1/OAKsIHiivLiiklMzp3SDTLehFV1 4w01O61o9XDERHG9kh1CQo7fT8H484S0rQJQp/Ck7WDEbTna5lPpAmImltufQEwVRk0f M3rQ== 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=fGNlFXtQRf9AsWYKhQCtNTFVhyPMJMmycxZMhvBAHrQ=; fh=1oaOtDPKrJahflgDzvESyfR8FC6mi/x4WJYS7DpyfkE=; b=JXS14XedrfJOh+I44COQxcs2ajP02c24kou2oHb9kVjKPBimXXt5zJsLMbxHfAGsjw X9/00pVXZlaG4ROs6WtCItY1v4lE3wGi1Ao4n3Tsv5BFss63S4oVC//d5kC+XXO0ctxo VQxK4eUzQyXGKhQTB09uAP6xWHO4m7EwEok43eQXdQfkO/TUraXR86f/x2Tgvxe99DO0 0hllG0/W9+o+3RCtLZDMMpmkYIcH1M58C+pi+A85SomwqvzSCMzOCXB0gwMjDkBvHFfc QJsTj3sxZOGLMRpqLrrmuMcsDOWiNyxQGc4UGagsuwdpV2iXcgyx9HCyQFgm7eL2Aocg aYfA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id z1-20020a056a00240100b0068ace3816d7si3420582pfh.387.2023.10.17.23.19.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 23:19:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id BB7158149724; Tue, 17 Oct 2023 23:19:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229700AbjJRGTJ (ORCPT + 99 others); Wed, 18 Oct 2023 02:19:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344468AbjJRGSU (ORCPT ); Wed, 18 Oct 2023 02:18:20 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32849D49 for ; Tue, 17 Oct 2023 23:17:56 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qszru-0001Zt-CO; Wed, 18 Oct 2023 08:17:22 +0200 Received: from [2a0a:edc0:0:1101:1d::28] (helo=dude02.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qszrq-002UYJ-Vy; Wed, 18 Oct 2023 08:17:19 +0200 Received: from sha by dude02.red.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1qszrq-00Evim-2p; Wed, 18 Oct 2023 08:17:18 +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 , Chanwoo Choi , 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, Sebastian Reichel , Sascha Hauer , Jonathan Cameron , Chanwoo Choi Subject: [PATCH v8 13/26] PM / devfreq: rockchip-dfi: Pass private data struct to internal functions Date: Wed, 18 Oct 2023 08:17:01 +0200 Message-Id: <20231018061714.3553817-14-s.hauer@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231018061714.3553817-1-s.hauer@pengutronix.de> References: <20231018061714.3553817-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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 17 Oct 2023 23:19:26 -0700 (PDT) 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 *. Reviewed-by: Jonathan Cameron Reviewed-by: Sebastian Reichel Acked-by: Chanwoo Choi Signed-off-by: Sascha Hauer --- 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 bdf421b248df9..d56a33d03db4c 100644 --- a/drivers/devfreq/event/rockchip-dfi.c +++ b/drivers/devfreq/event/rockchip-dfi.c @@ -73,9 +73,8 @@ struct rockchip_dfi { unsigned int max_channels; }; -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 */ @@ -103,18 +102,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; @@ -132,7 +129,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; @@ -149,7 +146,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; } @@ -167,7 +164,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 < dfi->max_channels; i++) { -- 2.39.2