Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5465019rwd; Wed, 24 May 2023 02:04:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5tAwV//xdnd/g1BndtJ//KxAQvCL/ymkdBerWIYlSD1K3+oW1fdUBEQcp/0j1Tul0kpyp3 X-Received: by 2002:a17:902:d489:b0:1ac:8835:b89b with SMTP id c9-20020a170902d48900b001ac8835b89bmr20521042plg.5.1684919076521; Wed, 24 May 2023 02:04:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684919076; cv=none; d=google.com; s=arc-20160816; b=ba0Wq5tyaIeTC/VNXwl8jHwIf9i1mLutqyyajjoRcO+HoWWcCzk4tJgXVytn7DEMjn N4yFb/B8xamCTobLX9iV4+jHt9eTlxLpnk0eOlJFpoupDJXijQAkyqYFE06ow3eDCeTB Vz7KShWbpfs6JV0XHUVIt7bdZBMzdDsvsFfCH4X4Ri5KRjuiWmYY2zLqkWn3JWdDyKkM 2En8FiGU6O4IEUT8iNlq0GTw/ae2dZEx1zy65phuHUb480rSUkG16bn56FgwY0EV61VK Tv+v3RS4TwqIav0ydCGMjyIdBLD8zgwc9j4TLzMoYhQriiOyQ+aW7ob38SoeDN5jXIPO ImPg== 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=zgSJctKUSJPYDf7hpcuHR32I1vYNeQ6pL3uzJBbba7U=; b=vtiwKZ4cXgRu39Gwz5XJZQcpzCeenhi7p940rIGPsAuz9B3JCJZmcmJqTkXVChxOot ELCt1fR5MYjthXHod5xYMV47/6Jhtg1UnVCXizXJfKi083fPQ07ZkGz00uuKF4kdK88L 5DXbdi60165uPflqDSvsouzh9jg5WHpFIs7579fYy6epQ/LadhBSeG3hLYwvKiKlck7j q7mWOz/ZoYs3OgGPNKy04+ZAPsgzcWT5wWNMW3tix6NaOepZsfdimm7pB2nWytJ0ZnxM Hlgjgk9hy+pszUyJWkU1HXIaLSsOzTZfAACTVDSR2R/9DI7d7HiLEgdORRb8Q619qie1 BlPQ== 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 n13-20020a170902e54d00b001a9baadecc0si4053674plf.160.2023.05.24.02.04.24; Wed, 24 May 2023 02:04:36 -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 S240463AbjEXIgo (ORCPT + 99 others); Wed, 24 May 2023 04:36:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240305AbjEXIgB (ORCPT ); Wed, 24 May 2023 04:36:01 -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 6FB41212F for ; Wed, 24 May 2023 01:34:30 -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 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 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 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 --- 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