lkml.org 
[lkml]   [2016]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] regulator: axp20x: Handle regulator_register returning ENODEV
Date
Handle regulator_register returning ENODEV, this may happen when
the dts node for the regulator contains "status = disabled" which
is useful for the ldo_io regulators, to avoid the regulator code
getting in the way of gpio use of these pins.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/regulator/axp20x-regulator.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
index 5ddaa82..500d162 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -423,6 +423,9 @@ static int axp20x_regulator_probe(struct platform_device *pdev)

rdev = devm_regulator_register(&pdev->dev, desc, &config);
if (IS_ERR(rdev)) {
+ if (PTR_ERR(rdev) == -ENODEV)
+ continue;
+
dev_err(&pdev->dev, "Failed to register %s\n",
regulators[i].name);

--
2.7.4
\
 
 \ /
  Last update: 2016-04-27 16:21    [W:0.052 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site