Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3599980rdg; Tue, 17 Oct 2023 23:19:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHCAiMBSrehGypzmIv0a+9MtF/mTUlQfJPnV1xB0gquiYe1HFuQFLVYWHYz1V6RKNOuJ6IF X-Received: by 2002:a05:6a00:22d0:b0:6be:5e64:babb with SMTP id f16-20020a056a0022d000b006be5e64babbmr5182093pfj.18.1697609965931; Tue, 17 Oct 2023 23:19:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697609965; cv=none; d=google.com; s=arc-20160816; b=UFe7RgnkamCqKXuL7sHrgWSAgYwolfncopJr7d+QPO/bxwNzfDVMyua8Sw3TCH6daw g0xlEP139nAzHrfvsos4K7TNPldaSDsAbnhKSMAqPU3esY3mvvnMDHOqXPO0R0U82nnQ p98QZ8goRFa6DrK2+xD/rO/V4mIS8PQEysLdxJASvK4OlaWrKIFGPMRJttOExtgGwldh H/klQ6ywQHWK30l5JDBEfwJNpOcISNc6n9gO2JV8wxMOfsy8RziY+mDl32hhIOfogjLK BdqkQ8bmnhUp4Ch5s5vqlqo2NnWQSB5TcqVDrzdEXTp33hqlR9B6BDdLj8lImYN3xyuB XMWA== 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=gAMP+42Q3KLeV4PczST5vc1c4m4VDJHI9qvMrpPmdv0=; fh=fCKtpw9CfdQ3PvVD3VDWQjIZjGoF8tkGHyUGDo9ja4M=; b=cfaNigmKy+DN+sRl1+1tj9LtcM2JkpsJT8P7pP+NeYGoVk4/gF7bJ1uz6OrPNl3bfR GaG8XPUMYVtjysSCy2rEyflv/wYQwDDTr6Av5YaufvraFoBfesXkxq8dz4l+/1GXdZCi v3DY/lBjr3/l/hzc+kszRYNC9FOA1Bdy2kCy/nzPo/w0LeSaIXlLqqW+PYnVTNZc3DA5 jpbYp/xVeErdouY3OBnM4jJwcYKh3leES2Yyfp2V6z4TnytO0qXvsLr3/OLeFO/YUJDS TNXjnRxCgq3HHcoHuctHBupHm8glfhHkfdmpBBNE5f2lbYB2Qp0WoD27fLNCuTPzMZ3o dcuA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id z6-20020aa78886000000b00690ba709d02si3451113pfe.381.2023.10.17.23.19.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 23:19:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id A66FE80F9BCE; Tue, 17 Oct 2023 23:19:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229669AbjJRGTP (ORCPT + 99 others); Wed, 18 Oct 2023 02:19:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344600AbjJRGSW (ORCPT ); Wed, 18 Oct 2023 02:18:22 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBEA2D51 for ; Tue, 17 Oct 2023 23:17:57 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qszrx-0001Zi-7N; Wed, 18 Oct 2023 08:17:25 +0200 Received: from [2a0a:edc0:0:1101:1d::28] (helo=dude02.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qszrq-002UXq-Kg; Wed, 18 Oct 2023 08:17:18 +0200 Received: from sha by dude02.red.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1qszrq-00Evht-1i; Wed, 18 Oct 2023 08:17:18 +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 , Chanwoo Choi , 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, Sebastian Reichel , Sascha Hauer Subject: [PATCH v8 01/26] PM / devfreq: rockchip-dfi: Make pmu regmap mandatory Date: Wed, 18 Oct 2023 08:16:49 +0200 Message-Id: <20231018061714.3553817-2-s.hauer@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231018061714.3553817-1-s.hauer@pengutronix.de> References: <20231018061714.3553817-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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 17 Oct 2023 23:19:22 -0700 (PDT) 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") Reviewed-by: Sebastian Reichel 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