linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] regulator: pwm: Do not print error on probe deferral
@ 2020-08-06 15:55 Thierry Reding
  2020-08-06 16:15 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Thierry Reding @ 2020-08-06 15:55 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: linux-kernel

From: Thierry Reding <treding@nvidia.com>

When the pwm-regulator driver fails to find the enable GPIO because of
probe deferral, prevent it from potentially spamming the kernel log with
error messages that are not useful.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/regulator/pwm-regulator.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/regulator/pwm-regulator.c b/drivers/regulator/pwm-regulator.c
index 3234b118b53e..dc99ac9b0cdf 100644
--- a/drivers/regulator/pwm-regulator.c
+++ b/drivers/regulator/pwm-regulator.c
@@ -370,7 +370,9 @@ static int pwm_regulator_probe(struct platform_device *pdev)
 						    gpio_flags);
 	if (IS_ERR(drvdata->enb_gpio)) {
 		ret = PTR_ERR(drvdata->enb_gpio);
-		dev_err(&pdev->dev, "Failed to get enable GPIO: %d\n", ret);
+		if (ret != -EPROBE_DEFER)
+			dev_err(&pdev->dev, "Failed to get enable GPIO: %d\n", ret);
+
 		return ret;
 	}
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] regulator: pwm: Do not print error on probe deferral
  2020-08-06 15:55 [PATCH] regulator: pwm: Do not print error on probe deferral Thierry Reding
@ 2020-08-06 16:15 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2020-08-06 16:15 UTC (permalink / raw)
  To: Thierry Reding; +Cc: Liam Girdwood, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 519 bytes --]

On Thu, Aug 06, 2020 at 05:55:15PM +0200, Thierry Reding wrote:

>  	if (IS_ERR(drvdata->enb_gpio)) {
>  		ret = PTR_ERR(drvdata->enb_gpio);
> -		dev_err(&pdev->dev, "Failed to get enable GPIO: %d\n", ret);
> +		if (ret != -EPROBE_DEFER)
> +			dev_err(&pdev->dev, "Failed to get enable GPIO: %d\n", ret);

This will not provide any diagnostics if there's an issue with probe
deferral it'll be hard for people to figure out what's going on.  At
most lower the severity to dev_dbg() but don't totally remove the
logging.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-06 17:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-06 15:55 [PATCH] regulator: pwm: Do not print error on probe deferral Thierry Reding
2020-08-06 16:15 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).