Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp307664iol; Thu, 9 Jun 2022 04:24:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9DAcCOa+vRROWfTl2ctqp95Hnqf44bpwbyJNM8QfGZn6detKIZo5Th1VKz4gTBpwvtpKK X-Received: by 2002:a17:906:8467:b0:705:7895:8f84 with SMTP id hx7-20020a170906846700b0070578958f84mr35555989ejc.107.1654773895016; Thu, 09 Jun 2022 04:24:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654773895; cv=none; d=google.com; s=arc-20160816; b=V8NMtUurjq6vIlmD9OdKtdFOOlryeUpIuQXakNQglTvzkDkaARZtQ3OZ+eTQpBVR+d +zCn34PQmyyln173wDBxTNA70nFrI2lsUbcGX4TrHT+IaHsQWc2c+uqjQhTnZWaa7meR qnWoGqQjyyXp8ZJ990LAiyDPau5LYZDHeXdzcSN6SQJQWQuDufHSUU3l6M9y31qQbebw kpUguQ6nPfyWxzp5+2wA6loffmRUflOyGAIdUKYreP/3uY55ePnyLZf0xgmir3T5b+J6 4KRf86gtAo60WswoZcNwWoj1cQXIMZ/umLJ5kDMmqK0733WQSy+rILCmP2/qTHS+CCo5 U74A== 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 :message-id:date:subject:cc:to:dkim-signature:from; bh=UIUoKTjbHuBPC+pvfRfGSeLeGa1xfixtOJQcipR5NWM=; b=q2Z0uL72MF3d8SdLmuJAhP0AyBC66hU9ptJQ4Ld6IvYkgPxDvxQoEbx9OStswOLZ86 ZZ1O35dlZWEUIgybbJpCfaqawhMrU6yfrvfOzX/GJDoNZyAGP8RykXi6Usf+hGr/9KK8 3vyVCTrzIRBynq6sAqHOyGJrIXasTLYp/FJL0puWJsLdaOllfPNXPAD12dQLutrDD7wK LeZ8P+1wxN/cH7zXxTnfNdSOKMZtoxMgbFVTPxniiKLQMSwVs1arWbMAiRVz7FEUZ9dL 8PsrgObZdf4PvG/wPcRZz7sR6r+2Nb1ZPaR5MfzvaRC32Ue1O2Gb5rm/Trl3DwsoaXWI F1yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@puri.sm header.s=comms header.b=bwfPRCPy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=puri.sm Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s27-20020a170906221b00b006ff2e46e8cdsi1498547ejs.980.2022.06.09.04.24.28; Thu, 09 Jun 2022 04:24:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@puri.sm header.s=comms header.b=bwfPRCPy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=puri.sm Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229771AbiFILR2 (ORCPT + 99 others); Thu, 9 Jun 2022 07:17:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242319AbiFILR1 (ORCPT ); Thu, 9 Jun 2022 07:17:27 -0400 Received: from comms.puri.sm (comms.puri.sm [159.203.221.185]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D926834BAB for ; Thu, 9 Jun 2022 04:17:25 -0700 (PDT) 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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; } } -- 2.30.2