Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3600652rdg; Tue, 17 Oct 2023 23:21:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IErSZhi7EkaJzfTq4qYfi77Fs9taVxkdmvT6hrfQpbxmUqpQI/zOqKswqyjyRsBOHOomMpI X-Received: by 2002:a05:6a00:15c5:b0:6b8:69fa:a11 with SMTP id o5-20020a056a0015c500b006b869fa0a11mr5584266pfu.12.1697610076684; Tue, 17 Oct 2023 23:21:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697610076; cv=none; d=google.com; s=arc-20160816; b=cQmYbRr3ud2xxxRuGH7lk2W2jxJJX3SFt/FONEfLyz5JRrG/mJ+NFTPIH8YTVj8PWu 14Q04a80bGnvB2qSJ+YONbBH4J9+X9b2WWCQD6hEDyNxHjPa4nVpPCP7599TgXxS2Dmv 5qrJxtHBRMXZ97vITpTsMNm0/1BQgnYnGqfP5u43y0KyyAHn6CSswxbWIGCwN6w6EhGt 3Wxd5p+q7jvIr360TJ7jdO3fYfv3ELazvBA7n19Cm/NLOglxDKmCG0UlrG5h0WtZ6K48 YESbolqPHmg6lfOsCKY1ZEL/YBdryeJU22Sbx6rKCiVbgwiTRp8BvWJmuTzHlln/xpnT pnMQ== 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=mIAjzTJNoziz+nXn9Vvs1nFcoL2STNA6NQSqFxPoxwk=; fh=6xF4X6QX8zbKbtNoU8rIc9H/VR307vJhQimzpDf6rGM=; b=ryL0zc/dlaKmOCfgObnJpGoaMPkfymBBN1LClmcOKEbWy/lPi/+2BPvbDM/tboN0wp aC+Pn5EVXU1YDu47Af/7CxUp9LvG1DxKaeJCbpZSBdVjduL3wwBJLms3SQRnQuHurCEf x8bwbKjjViVD3Ci0mMYUV3dFO3Hik4SBgmPDTxVezWt/Mc1Ike3ZJMCvETwDD9pAVcNw /U7RYx1bhlCer88K9ZF5fpRYrKyHnX/UzZYXkcsVBgosGAGlqyzS3kDrVGB46bFr4FSL pVoaD65/6RDcq292+iR7WnFTXrsr7GjkTpsmp8U9OV+arsmTufxcYEYi5bgpNeQ2g1Ev PWhQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id bs191-20020a6328c8000000b005652bd27e80si1463284pgb.588.2023.10.17.23.21.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 23:21:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 CD2FF8067F4F; Tue, 17 Oct 2023 23:21:13 -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 S229652AbjJRGUw (ORCPT + 99 others); Wed, 18 Oct 2023 02:20:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235050AbjJRGUl (ORCPT ); Wed, 18 Oct 2023 02:20:41 -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 159B41735 for ; Tue, 17 Oct 2023 23:18:15 -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-0001Zj-CH; 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-002UXr-L9; Wed, 18 Oct 2023 08:17:18 +0200 Received: from sha by dude02.red.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1qszrq-00Evhx-1p; 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 Subject: [PATCH v8 02/26] PM / devfreq: rockchip-dfi: Embed desc into private data struct Date: Wed, 18 Oct 2023 08:16:50 +0200 Message-Id: <20231018061714.3553817-3-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:21:14 -0700 (PDT) No need for an extra allocation, just embed the struct devfreq_event_desc into the private data struct. Reviewed-by: Heiko Stuebner Reviewed-by: Jonathan Cameron Reviewed-by: Sebastian Reichel Signed-off-by: Sascha Hauer --- drivers/devfreq/event/rockchip-dfi.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/devfreq/event/rockchip-dfi.c b/drivers/devfreq/event/rockchip-dfi.c index 74893c06aa087..467f9f42d38f7 100644 --- a/drivers/devfreq/event/rockchip-dfi.c +++ b/drivers/devfreq/event/rockchip-dfi.c @@ -49,7 +49,7 @@ struct dmc_usage { */ struct rockchip_dfi { struct devfreq_event_dev *edev; - struct devfreq_event_desc *desc; + struct devfreq_event_desc desc; struct dmc_usage ch_usage[RK3399_DMC_NUM_CH]; struct device *dev; void __iomem *regs; @@ -204,14 +204,10 @@ static int rockchip_dfi_probe(struct platform_device *pdev) data->dev = dev; - desc = devm_kzalloc(dev, sizeof(*desc), GFP_KERNEL); - if (!desc) - return -ENOMEM; - + desc = &data->desc; desc->ops = &rockchip_dfi_ops; desc->driver_data = data; desc->name = np->name; - data->desc = desc; data->edev = devm_devfreq_event_add_edev(&pdev->dev, desc); if (IS_ERR(data->edev)) { -- 2.39.2