From patchwork Thu Jun 9 11:17:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kepplinger X-Patchwork-Id: 12875278 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 0C05FC43334 for ; Thu, 9 Jun 2022 11:18:35 +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=HEZqpazdXbmBdyh/hrYcXuoInfjaA3oZGSbDUEIH0l4=; b=laRGtrepfwnFcv xv1yFd9wTzQ3fNmmi+ktqahQKYSZnJ0Jlf5Z3EeawFcjMQyxHoFzx9s+COqen9/NCGdIxLyl2JRub vDwrCqvGcsgvlPxYgXUhQQMcjne635NhExnEZev+K403FFQnc+kzieXjsPm36IWbXiRKc8PGgUzIY lwC9eYUy34ogjvp7kRg7hPid+CVeyOU9Mjm2aZS+dlcrtTZ3NMkDvt72bCRRj85xH3jWAJd0CS1tQ j2+g4xZAJ9ZeF59hoiVG7RDDgcQQlv+4jab2BJIqJrBTXeNfwm3vCbWH6KgLimtZV9dhTv1HLv4UN BIcIdcgFgaesAvc3cSyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nzGAQ-001Dsr-2X; Thu, 09 Jun 2022 11:17:34 +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 1nzGAM-001DpB-EF for linux-arm-kernel@lists.infradead.org; Thu, 09 Jun 2022 11:17:31 +0000 Received: from localhost (localhost [127.0.0.1]) by comms.puri.sm (Postfix) with ESMTP id 88B14DFDE2; Thu, 9 Jun 2022 04:17:25 -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 AdmpqNhmYmWs; Thu, 9 Jun 2022 04:17:24 -0700 (PDT) From: Martin Kepplinger DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=puri.sm; s=comms; t=1654773444; bh=304FzTc7kUGpYL6mGifeAk9dzSjFz6UXTYRUkbSJLYM=; h=From:To:Cc:Subject:Date:From; b=bwfPRCPyEtBLaKFBANzW1EfITBel1MbMTpIqxVevsDRz8FlsIzEOTdP3777X5jOgo Q7OJKXJ+A0k7gziDsfYO1kWfeNf9dMcfHfY6OplonoyGXYL9cEdttyy0gTRCt9521M QdsJO9OPaMkZUDiDx7ef8cIiAVJj3Zrj+Y7GQKcqLneiKpRyy6FDH/oPXBzAifWC+S CoXXLEzCKY5lLt8ims7du21LbPJvrTxCiqmsVN8DKTNIQSYAXiD6qoTRso8G3cw9XJ nHa2cN0bb0cWC7qI5Ck5iYVN0CbAnRVMa0isab5C2SL1STX0s7BXdirnP1rN1o0vqG G9qUsc7uTAeEQ== 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 v2] soc: imx: gpcv2: print errno for regulator errors Date: Thu, 9 Jun 2022 13:17:07 +0200 Message-Id: <20220609111707.2216036-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_041730_507624_748BB225 X-CRM114-Status: UNSURE ( 9.15 ) 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 --- revision history ---------------- v2: (thank you Ahmad) * use %pe format * sent out a bit early because it's pretty obvious v1: https://lore.kernel.org/linux-arm-kernel/64828809-1eb7-dff3-da57-95b545aefc22@pengutronix.de/T/#t drivers/soc/imx/gpcv2.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c index 85aa86e1338a..6383a4edc360 100644 --- a/drivers/soc/imx/gpcv2.c +++ b/drivers/soc/imx/gpcv2.c @@ -328,7 +328,9 @@ 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: %pe\n", + ERR_PTR(ret)); goto out_put_pm; } } @@ -467,7 +469,9 @@ 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: %pe\n", + ERR_PTR(ret)); return ret; } }