From patchwork Sun Aug 25 18:31:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13776871 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 14ABBC5320E for ; Sun, 25 Aug 2024 18:32:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=r5oZsSpqBtpVnxWWek+saFNNQcQXhk4VKnzKr/UGi3k=; b=wKJFW5ARNrgpEiGt4DUFCs79uz JUHTNpgLTK9h6+faoiFwzWAj3C7sn7QXV2sQIUN9J4N3Agm8aXYVhR2XxpvkDdaajCk3rGDLon5iN 3ph9j0dh37V8JmkSo90p+KzGhMhJ3t2Qx/VYRHBjx4OoRSOKP9G8E/C4/Ga3CpY4DI8qPeuAsvNUQ lc7s0f+g1fLizW8kkMturyFYdZgPBvi/KdD0g9kc39zGkshNq7wHRSU5JO2nr2eletfMa6fIfaVDG N9IKj7xw0RXIEaVL6w2bHepQ07pcraMx4xsXpF/27Ut0n+Wc4el9qOl9fsQx0k6V/0mutT72YmUKu yvXrSArg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1siI2b-00000004ogC-3a8O; Sun, 25 Aug 2024 18:32:41 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siI1J-00000004oRq-3mVr for linux-arm-kernel@lists.infradead.org; Sun, 25 Aug 2024 18:31:23 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-428098e2b3bso4100305e9.3 for ; Sun, 25 Aug 2024 11:31:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724610680; x=1725215480; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=r5oZsSpqBtpVnxWWek+saFNNQcQXhk4VKnzKr/UGi3k=; b=pAajsD1+PqTz6HPkK70WgNtTg8IPVXJq6biIoZ7up7EG6E2edawbjaGAEzOrA/4wsj gvtSzmzblBBRrH54C5OI5HuROTKhfwUM/bVWqEJ3tMLGGxkqn8luna7QoPbRA9m2lUOp T8ARboS36ZoihIUqyhPBcOcjtU1FrXRax9zRYUt5pl2XSHfhcR4UWL69mQ6VbI6Yvx32 6zM1CKJpBDzE4c5cYODQ//0Pglkuf9ascEFJkUep3P1jFpzadqR4au9NHgXu0qjq4iUY WrtgEeYTfHbmbwWZMIqAKrx49Xr+9CUydwUAzTPpTFTMFXyaFLr5dFpxiKTEUinVRLjM h14Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724610680; x=1725215480; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=r5oZsSpqBtpVnxWWek+saFNNQcQXhk4VKnzKr/UGi3k=; b=D6cdySkWceeqTFVNOysHr1V0nxDxAJvI2Edllvzv2MpXhoMV0NXWGreddrtTugL9Oc TTDn2DaWga7rGQlrTduMlSQDZ5fqypvJEBZlhFKBtdRccN/KqPlEiy+WEFK2ZsX0PGFQ H6qm32W4qYZYxkaazI3pO8GXrRVwy1zaTCmhgRbuPRs3DMmMsuSDaDK5S5TzcQErgExO EdAMoXRo0Rew6ssZOXU54qy0Hk99sbeDwVDP+kPbncHCQG8xHf+7LVvrqZ2EAsz/wSTu +oqHuqu66hfOGGO+0jwJnmOB1cBe7TqBSTQPxqYgJD6GOSc/lNMw9JmOGq+h65OU+ZcK bOOA== X-Forwarded-Encrypted: i=1; AJvYcCUzQ+GTsuOkwwhZZo+s4dQG1aHnVn0Oat/1na5+7giRN88YxLkW1U3kHe+6Tyi2SyI/WA/dweYt5wSRuIGRxRPo@lists.infradead.org X-Gm-Message-State: AOJu0Yw3PnzTrRMa67rU8H+zSjy4mk3IAwm+jbIQG/aLnO3TtthW3h8w qK5F0FlVIFI5nyeKwsPMbaOdu5AvVC6HEJvnLRym+8bhia6Luw0Y0u80HTzwKes= X-Google-Smtp-Source: AGHT+IExUeevkTIQSWB4GNDROugF9P/4Ht1vXHY2Hj6A+8kgBoxqFRUstIlxcvyBnYWjZpE2OjAmHg== X-Received: by 2002:a5d:5f8b:0:b0:36d:1d66:554f with SMTP id ffacd0b85a97d-3731185d6camr3061819f8f.3.1724610680074; Sun, 25 Aug 2024 11:31:20 -0700 (PDT) Received: from krzk-bin.. ([178.197.222.82]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3730821ab05sm8937319f8f.98.2024.08.25.11.31.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2024 11:31:19 -0700 (PDT) From: Krzysztof Kozlowski To: Ulf Hansson , Heiko Stuebner , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH] pmdomain: rockchip: Simplify dropping OF node reference Date: Sun, 25 Aug 2024 20:31:16 +0200 Message-ID: <20240825183116.102953-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240825_113122_054480_E439CECD X-CRM114-Status: GOOD ( 11.31 ) 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 Drop OF node reference immediately after using it in syscon_node_to_regmap(), which is both simpler and typical/expected code pattern. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Heiko Stuebner --- drivers/pmdomain/rockchip/pm-domains.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/pmdomain/rockchip/pm-domains.c b/drivers/pmdomain/rockchip/pm-domains.c index 64b4d7120d83..5ee7efbd2ef8 100644 --- a/drivers/pmdomain/rockchip/pm-domains.c +++ b/drivers/pmdomain/rockchip/pm-domains.c @@ -716,12 +716,11 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu, goto err_unprepare_clocks; } pd->qos_regmap[j] = syscon_node_to_regmap(qos_node); + of_node_put(qos_node); if (IS_ERR(pd->qos_regmap[j])) { error = -ENODEV; - of_node_put(qos_node); goto err_unprepare_clocks; } - of_node_put(qos_node); } }