From patchwork Wed May 24 08:31:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sascha Hauer X-Patchwork-Id: 13253561 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 BCFA0C7EE2C for ; Wed, 24 May 2023 08:55:10 +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=qxBhG3/Tpp2riOgSMYzsEsYT3oWcnMkCPtYBWLlFEpw=; b=HMASYgzF9qzqpo OdZjaG3X8OadjIssH7OHUyViNYXDtE22XYomBMEPMkQAIVAEWPj6Fob1KpZyY7ASq9OgnLFuYtCUT Xm6MoOV3uKJTKG1BckDBPfq/sGIkM4D8zWpiFkfDfDk1dy0f8foKrd30hmX2JKW0XZ7SIHr6y9n7n aA1ODhjHn9J7EIfXmCdIQxKZvKfAcPAg1cL60GB7Tk3HLPs6huzTFpNZ7kXI+S5jZKvycTj80mmtx YSE1C2hB13EFmKe5u3cOcXHPyKErycM2oIvS/El6evi3LkD5V1yruvT+zYYB4cZ6HVZH7MzW4eNJ/ 7FoCwZE6IKaPZnT/GPyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q1kGX-00Cr4z-27; Wed, 24 May 2023 08:54:41 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q1kGQ-00Cr2Z-1U for linux-arm-kernel@bombadil.infradead.org; Wed, 24 May 2023 08:54:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=Dsf3JeRexeL0GN+rvcZrwbg34Ba5mbrEhOzcmtDOfg4=; b=MTX93x2dodrFalgEqNANMlfMy+ A8MYKdGe7k8lkBrYnOFC5hm70C2tZYJrbz05PTjvHooQAbY75nRUGfBxUh+oJOWBTUSGieYzY18Qr kGolbFNwUaPIudjgL31uwofoSx4JRU2vhZlxjwsAuRYbqyMp6Wg0nGdLKeu92JyP0rKttIqNLEEMR RUibsuNiYeQz4AS7RTw5aTp5dxfOaxc3qvBenSNPNmQzDCOnAJSlXAkVyBNWNUoY5yfXG59DKSd+F 5WMsArUjqCZKFpFuiqS77RBmY9ilnk4WCzur488Zu9vJfcnIShUatnzwTmnEP8n499GcIXKOyAev3 GCJtQ8Ng==; Received: from metis.ext.pengutronix.de ([85.220.165.71]) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1q1jw9-00B1J8-Qc for linux-arm-kernel@lists.infradead.org; Wed, 24 May 2023 08:33:39 +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 1q1juY-0002l7-Rl; Wed, 24 May 2023 10:31:58 +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-002RZ9-Jo; 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-009j0k-Ql; 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 Subject: [PATCH v5 01/25] PM / devfreq: rockchip-dfi: Make pmu regmap mandatory Date: Wed, 24 May 2023 10:31:29 +0200 Message-Id: <20230524083153.2046084-2-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_093337_888472_DA4A3084 X-CRM114-Status: GOOD ( 17.17 ) 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 As a matter of fact the regmap_pmu already is mandatory because it is used unconditionally in the driver. Bail out gracefully in probe() rather than crashing later. Fixes: b9d1262bca0af ("PM / devfreq: event: support rockchip dfi controller") Signed-off-by: Sascha Hauer Reviewed-by: Sebastian Reichel --- Notes: Changes since v4: - move to beginning of the series to make it easier to backport to stable - Add a Fixes: tag - add missing of_node_put() drivers/devfreq/event/rockchip-dfi.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/devfreq/event/rockchip-dfi.c b/drivers/devfreq/event/rockchip-dfi.c index 39ac069cabc75..74893c06aa087 100644 --- a/drivers/devfreq/event/rockchip-dfi.c +++ b/drivers/devfreq/event/rockchip-dfi.c @@ -193,14 +193,15 @@ static int rockchip_dfi_probe(struct platform_device *pdev) return dev_err_probe(dev, PTR_ERR(data->clk), "Cannot get the clk pclk_ddr_mon\n"); - /* try to find the optional reference to the pmu syscon */ node = of_parse_phandle(np, "rockchip,pmu", 0); - if (node) { - data->regmap_pmu = syscon_node_to_regmap(node); - of_node_put(node); - if (IS_ERR(data->regmap_pmu)) - return PTR_ERR(data->regmap_pmu); - } + if (!node) + return dev_err_probe(&pdev->dev, -ENODEV, "Can't find pmu_grf registers\n"); + + data->regmap_pmu = syscon_node_to_regmap(node); + of_node_put(node); + if (IS_ERR(data->regmap_pmu)) + return PTR_ERR(data->regmap_pmu); + data->dev = dev; desc = devm_kzalloc(dev, sizeof(*desc), GFP_KERNEL);