From patchwork Wed May 24 08:31:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sascha Hauer X-Patchwork-Id: 13253494 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 C8E2CC77B73 for ; Wed, 24 May 2023 08:34:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=A/UXcCqNAei90Yw1P4HxOkwEgQL/VA5RXEXFLVLH8Uc=; b=VnDJoHMrl28lsZ MAjT4qkSA8pIm2v23+zs7jBPEwLX3EAUo8c1SQXNytT2kZSGCCWV/N+RfAuQJa42McPIgt5CBssd+ /APrqGSwG87wtN+26iJmwudkOG2XLSRreyo5qD5yLMAd8LVFXmH7yK3Pyfw2iSsXQxmW7wbtdKsOa cjO+sVFHA4T0GKuNexlY13KMp99yfJTmkHOVv1jgkvU6iFIPDgR1o5CGJ56/djLfgHbOpmp2w8rPT PNgwk/vixCWlG5HYW3855zJA5evM6DNyjVf2mTFjs52DsIaLn1652hqaoJagp/0M2lnWPXpQz5zFH yd5iLj0F+0KUmiHN4pKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q1jwy-00Co0B-20; Wed, 24 May 2023 08:34:28 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q1jwq-00CnuH-2t for linux-arm-kernel@bombadil.infradead.org; Wed, 24 May 2023 08:34:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=zgSJctKUSJPYDf7hpcuHR32I1vYNeQ6pL3uzJBbba7U=; b=hzbOnsCm4gsn4dvtEe0op33eAw zEFsffSZKe3aXexQqmjO88WgZgv2DS7859nd7XUme+BXvVXcw4YbT1CuAsfUR77qqCwIQZmv/fhTM 8syX1kK5IbQ59gFxjXkQ3z8lTBHBrKpYqqTCPlgJE8Fn0XhCWgHiZXWRF8Km89L+Q0/ssOSSluR18 GHXKsdk+vxQi7zDHP6FQmy6aNaJg+AgP+gK+tPbHd2EZFaxnwSVRG568+F1kU/q8R8J6HMubc9YdS b+1Tb1oH/0DLCKb11sCn1G/dHnev2cx67rXGPab2ozbXJmWI9aWYpeLPtfiFRCX4KqcXxKfx73H2s brpHPBhQ==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q1jul-004wTo-0J for linux-arm-kernel@lists.infradead.org; Wed, 24 May 2023 08:34:19 +0000 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 1q1jua-0002l8-Jw; Wed, 24 May 2023 10:32:00 +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 1q1juW-002RZA-L3; Wed, 24 May 2023 10:31:56 +0200 Received: from sha by dude02.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1q1juV-009j1E-T7; Wed, 24 May 2023 10:31:55 +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 02/25] PM / devfreq: rockchip-dfi: Embed desc into private data struct Date: Wed, 24 May 2023 10:31:30 +0200 Message-Id: <20230524083153.2046084-3-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 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230524_093411_743181_FE1D5FE9 X-CRM114-Status: GOOD ( 15.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org No need for an extra allocation, just embed the struct devfreq_event_desc into the private data struct. Signed-off-by: Sascha Hauer Reviewed-by: Heiko Stuebner Reviewed-by: Jonathan Cameron Reviewed-by: Sebastian Reichel --- 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)) {