[PATCH 2/2] regulator/fixed.c: Don't report EPROBE_DEFER errors

Mike Looijmans
2014-12-09T13:13:07Z

If the regulator cannot be registered because its supplier is not
available yet, don't write an error. There is no need to alert the
user of probe deferrals.
This fixes a storm of error messages at boot when a GPIO controlled
regulator is supplied by an I2C controlled supply.

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
---
drivers/regulator/fixed.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
index d21da27..ac7c874 100644
--- a/drivers/regulator/fixed.c
+++ b/drivers/regulator/fixed.c
@@ -189,7 +189,9 @@ static int reg_fixed_voltage_probe(struct platform_device *pdev)
&cfg);
if (IS_ERR(drvdata->dev)) {
ret = PTR_ERR(drvdata->dev);
- dev_err(&pdev->dev, "Failed to register regulator: %d\n", ret);
+ if (ret != -EPROBE_DEFER)
+ dev_err(&pdev->dev,
+ "Failed to register regulator: %d\n", ret);
return ret;
}

--
1.7.9.5