From patchwork Fri Feb 3 12:49:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sascha Hauer X-Patchwork-Id: 13127481 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 7C739C61DA4 for ; Fri, 3 Feb 2023 13:01:06 +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=7Mi2/WlP5ftK8e47VYPTCM8ytIYQlJTTs1AXWlNOQus=; b=4EdQJM69nCeACw MMEqSFHwH4/QtxDAfQxVY5+60F26kWyPNiT1D8e30H4gT4lpLj5J6VZxjFr5E2hNAK2TVagDvyCtk VGBcUKOUNGTs9wQBpVf7nrkMSP2BPXmL3n0WwD/ay0meGRfrqmOZCYTGAENQhxLjlGfgTg7lXcA8o 3oT5D7bY3yanQi0/NDTYNApG57X16nB4s/8WR/ummL6aHgRTVoPs2wFozV58rckm92OFfb7Ls8KWN Mg0jPDbXsqDobtQ+fUqEittMC2MfSwkCxPFv3vWIrV7PcHRzRmxO5rD+H/jPz1BBR+uOWAXyeyNJP JanwGv8JeiMvoNGdbDvQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNvgY-001vMz-0u; Fri, 03 Feb 2023 13:00:58 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNvWd-001q7W-KU for linux-rockchip@lists.infradead.org; Fri, 03 Feb 2023 12:50:46 +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 1pNvWE-0000aT-5L; Fri, 03 Feb 2023 13:50:18 +0100 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 1pNvW9-002OpX-SF; Fri, 03 Feb 2023 13:50:15 +0100 Received: from sha by dude02.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pNvW9-000Zkb-Su; Fri, 03 Feb 2023 13:50:13 +0100 From: Sascha Hauer To: linux-pm@vger.kernel.org Cc: linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Heiko Stuebner , Kyungmin Park , MyungJoo Ham , Will Deacon , Mark Rutland , kernel@pegutronix.de, Michael Riesch , Sascha Hauer Subject: [PATCH 03/18] PM / devfreq: rockchip-dfi: Make pmu regmap mandatory Date: Fri, 3 Feb 2023 13:49:57 +0100 Message-Id: <20230203125012.3804008-4-s.hauer@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230203125012.3804008-1-s.hauer@pengutronix.de> References: <20230203125012.3804008-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-rockchip@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230203_045043_728415_266C11A1 X-CRM114-Status: GOOD ( 14.67 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=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. Signed-off-by: Sascha Hauer --- drivers/devfreq/event/rockchip-dfi.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/devfreq/event/rockchip-dfi.c b/drivers/devfreq/event/rockchip-dfi.c index 98712ac68aa5f..47cc9e48dafab 100644 --- a/drivers/devfreq/event/rockchip-dfi.c +++ b/drivers/devfreq/event/rockchip-dfi.c @@ -193,14 +193,14 @@ static int rockchip_dfi_probe(struct platform_device *pdev) return dev_err_probe(dev, PTR_ERR(dfi->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) { - dfi->regmap_pmu = syscon_node_to_regmap(node); - of_node_put(node); - if (IS_ERR(dfi->regmap_pmu)) - return PTR_ERR(dfi->regmap_pmu); - } + if (!node) + return dev_err_probe(&pdev->dev, -ENODEV, "Can't find pmu_grf registers\n"); + + dfi->regmap_pmu = syscon_node_to_regmap(node); + if (IS_ERR(dfi->regmap_pmu)) + return PTR_ERR(dfi->regmap_pmu); + dfi->dev = dev; desc = &dfi->desc;