From patchwork Thu Jun 9 09:44:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kepplinger X-Patchwork-Id: 12875125 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 310CAC433EF for ; Thu, 9 Jun 2022 09:46:25 +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: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:In-Reply-To:References: List-Owner; bh=HclXUL9iOcxruBzBUkrOu26rmIInSStzHXBz47Ffg08=; b=HYrPrxiuLRX5pC Cl8AO3ttKE2k9UC+EuiNW+/SUbjRExc1ubiIFdmP6yJbgelvVLiBxXX6EAGKEwID5DeTW1o7idX6q aWUfHXysIkuT+pZfRq/FC8MUmttHcTqTJbH6PdiLGRlkpCF5YCKj1nh2O5RlQW/r+DxYFJAX6i3F3 aH3aYLkG24Nimd13AnbOAtpPWv135Q4SeMmJ0RCZlxldvZL4jW+sC1e8keQ8c+MicqBZB5lrXYEFf Mku6thUss0ZgAiVHGh/WBP/qRqaCP2+XY0qmiG7Lz6am3C8DaEs1g0XeVW7de6wrwsRXsMsoJ9WGb btiKzPNikP5oXkHAH8XA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nzEjH-000l7A-Lw; Thu, 09 Jun 2022 09:45:27 +0000 Received: from comms.puri.sm ([159.203.221.185]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nzEjD-000l5a-L1 for linux-arm-kernel@lists.infradead.org; Thu, 09 Jun 2022 09:45:24 +0000 Received: from localhost (localhost [127.0.0.1]) by comms.puri.sm (Postfix) with ESMTP id 703BFDFDD0; Thu, 9 Jun 2022 02:45:23 -0700 (PDT) Received: from comms.puri.sm ([127.0.0.1]) by localhost (comms.puri.sm [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KnrSODr8z27T; Thu, 9 Jun 2022 02:45:22 -0700 (PDT) From: Martin Kepplinger DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=puri.sm; s=comms; t=1654767922; bh=13VRg4Lwk4+BEnm3SUM2cb0pYq53kKrwUDqrt4YlzQc=; h=From:To:Cc:Subject:Date:From; b=V9/MIKvNERmqtpSd5O4VRXuaCcwmEMjmDBxKaLvBGLG7nbWDxpahnGafIQcn2XF9K pxSwLPVxwZmqgUCV2eNHTmhDCGtGrzV4kSgEeU52EUlshc0JtoMnO8fim+PW5fcgDQ GzCjnEmNawpU6VUUx/pGgTz2MFMJJrRzzmHQWJGhnBULWeJmItGsyQrEuAsjUSG+Z5 WwKFxdasmbbMYweNJHiaL6lDIaFxevPb3RDGE4unaN4jNg400e6G7vXnN3hSRfd01E 9J9HW2LQuCCCehgah9orN5uxPsKa/GSTKGs/3caNnG8CWVLerxOm0eyhblGePQpX2l X2RF9MxOKC7cg== To: shawnguo@kernel.org, s.hauer@pengutronix.de, festevam@gmail.com Cc: kernel@pengutronix.de, kernel@puri.sm, linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Martin Kepplinger Subject: [PATCH] soc: imx: gpcv2: print errno for regulator errors Date: Thu, 9 Jun 2022 11:44:53 +0200 Message-Id: <20220609094453.2120099-1-martin.kepplinger@puri.sm> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220609_024523_709462_71C9C8A9 X-CRM114-Status: UNSURE ( 8.63 ) X-CRM114-Notice: Please train this message. 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 Make debugging of power management issues easier by printing the reason why a regulator fails to be enabled or disabled. Signed-off-by: Martin Kepplinger --- drivers/soc/imx/gpcv2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c index 3cb123016b3e..311507a815c5 100644 --- a/drivers/soc/imx/gpcv2.c +++ b/drivers/soc/imx/gpcv2.c @@ -233,7 +233,8 @@ static int imx_pgc_power_up(struct generic_pm_domain *genpd) if (!IS_ERR(domain->regulator)) { ret = regulator_enable(domain->regulator); if (ret) { - dev_err(domain->dev, "failed to enable regulator\n"); + dev_err(domain->dev, "failed to enable regulator: %d\n", + ret); goto out_put_pm; } } @@ -372,7 +373,8 @@ static int imx_pgc_power_down(struct generic_pm_domain *genpd) if (!IS_ERR(domain->regulator)) { ret = regulator_disable(domain->regulator); if (ret) { - dev_err(domain->dev, "failed to disable regulator\n"); + dev_err(domain->dev, + "failed to disable regulator: %d\n", ret); return ret; } }