Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5446511rwd; Wed, 24 May 2023 01:44:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5xp542tnAu8jJJbQ9mbcSahsScxvOSjh17YfYiVd+wlwnTJRay49ObcEAXGSuX6KO9MKru X-Received: by 2002:a17:902:ced0:b0:1af:b9ed:1677 with SMTP id d16-20020a170902ced000b001afb9ed1677mr8132284plg.2.1684917847901; Wed, 24 May 2023 01:44:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684917847; cv=none; d=google.com; s=arc-20160816; b=JRLbB2phR2xPFpA3MxWBg4P7uPXzWEdPaxJ4FGlxmkjv+i1kFWLb9L/BZkC4qkld0Y QAVWk/1pFZ43QaqhExLDwNPSjTWSSkUd2hURI8CDL2E6hZpzFRNujFxIhmqk7QsZ3TSb OKuhqsnBAl3kDnuA1iYjO/Oh4aqp8XJyNYiDdAXyEvIs+85pfpJ6HBW1aqVSTUixXQVR 3rGo4QCvkgp6x9pQmnNdOF7F31t7E6pylNZcp2TCkdby3Qsy0BhcfCote0H8WtAc0NGO bVHJpRuH71Y8koJXvKcd9m6SQTlHRAHUSHR5yxYcQgIjQhgWq+eU+X2PdAi+hsoh4mSH X/EQ== 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=Dsf3JeRexeL0GN+rvcZrwbg34Ba5mbrEhOzcmtDOfg4=; b=QZXEWKWrdZ16LuxQ2YIU8M/EsBNrYxAtwIZYSf485MCWxyXl0QLUg4s52F2aW44lWL 5k+Xl/36jWDvenQ+W4jGzcJdozTMqWIZTaHJTrZm/8Exr0f/hjMbUNzScQ4ghs7x+zmH iIU+QTnWUfD9Sj6H7mVhI8lzlFU9iOj4IuAimtjp2BZF3A6BGOzac6p5vUdRVcLVQcUY w7dUZ9DqqSGx37A+dzEUIlKasrvX/RJD/jU1QfIX4HDVoizEkLEjY8zW+GS4+FCGvEBA PdtAHggHe1GmYl6ohxAK28ahSJvbT/KkQBjEwYPk4EWJthTF0OkHTsrHn0eJCIKtJK1w cYuw== 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 4-20020a170902c24400b001ac83d19265si452982plg.291.2023.05.24.01.43.55; Wed, 24 May 2023 01:44:07 -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 S240210AbjEXIck (ORCPT + 99 others); Wed, 24 May 2023 04:32:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240179AbjEXIcd (ORCPT ); Wed, 24 May 2023 04:32:33 -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 DB4AE1AC for ; Wed, 24 May 2023 01:32:28 -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 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 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 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 --- 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); -- 2.39.2