From patchwork Wed Aug 21 18:12:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 13771973 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 AE4BDC52D6F for ; Wed, 21 Aug 2024 18:16: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:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To: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:List-Owner; bh=zLBpo8GlfyUpdppLlG6ukHijZu/gSxmkvzIJ09hDL68=; b=hmtri9Lg3SYA9zwVroc9OQ524k fJXK+NTq/dm89F/fgVYBfhgvAQitS6fIsMfFBU0UDIAbIydlPbxlGX78h9a7EgQmepEHADP6reZ/n lDiEHkeQ6DXr8R5wXyU3CkjAhttppgOt6CknaCr+YckFsykvHUXI1g9Lfcv4hfHLm/oKC2e2Kv9RK pbsf0YQ9DDZ4sgJuIq40fdGXJW6vEAKC/HyY5fIyvPC9AqcHNn7kfu8CR9ioaL4MyBo8zITtZlw4/ 5hegeHq4xZKvMtwNcb8/FaNboE4TFTSAw2JKL9KkrPYE8Zrr+5Z3Uxbz0qVC9lTmU+WrMAjRDSWMz wgwe9b5Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgpsB-0000000A2QU-418O; Wed, 21 Aug 2024 18:15:55 +0000 Received: from akranes.kaiser.cx ([2a0a:4cc0:1:11ef:4484:ccff:febf:ddfa]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgpq6-0000000A1zN-0hZQ for linux-arm-kernel@lists.infradead.org; Wed, 21 Aug 2024 18:13:48 +0000 Received: from dslb-178-004-206-174.178.004.pools.vodafone-ip.de ([178.4.206.174] helo=martin-debian-3.kaiser.cx) by akranes.kaiser.cx with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sgppV-00227j-2m; Wed, 21 Aug 2024 20:13:09 +0200 From: Martin Kaiser To: Herbert Xu Cc: Aurelien Jarno , Daniel Golle , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 2/2] hwrng: rockchip - handle devm_pm_runtime_enable errors Date: Wed, 21 Aug 2024 20:12:35 +0200 Message-Id: <20240821181235.22270-3-martin@kaiser.cx> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240821181235.22270-1-martin@kaiser.cx> References: <20240821181235.22270-1-martin@kaiser.cx> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240821_111346_230628_C5505335 X-CRM114-Status: GOOD ( 11.92 ) 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 It's unlikely that devm_pm_runtime_enable ever fails. Still, it makes sense to read the return value and handle errors. Signed-off-by: Martin Kaiser --- drivers/char/hw_random/rockchip-rng.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/char/hw_random/rockchip-rng.c b/drivers/char/hw_random/rockchip-rng.c index 0dff9de64bc5..289b385bbf05 100644 --- a/drivers/char/hw_random/rockchip-rng.c +++ b/drivers/char/hw_random/rockchip-rng.c @@ -169,7 +169,9 @@ static int rk_rng_probe(struct platform_device *pdev) pm_runtime_set_autosuspend_delay(dev, RK_RNG_AUTOSUSPEND_DELAY); pm_runtime_use_autosuspend(dev); - devm_pm_runtime_enable(dev); + ret = devm_pm_runtime_enable(dev); + if (ret) + return dev_err_probe(&pdev->dev, ret, "Runtime pm activation failed.\n"); ret = devm_hwrng_register(dev, &rk_rng->rng); if (ret)