From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hans de Goede Subject: [PATCH 2/3] regulator: axp20x: Handle regulator_register returning ENODEV Date: Fri, 11 Mar 2016 22:01:08 +0100 Message-ID: <1457730069-31760-2-git-send-email-hdegoede@redhat.com> References: <1457730069-31760-1-git-send-email-hdegoede@redhat.com> Return-path: In-Reply-To: <1457730069-31760-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Maxime Ripard , Chen-Yu Tsai , Mark Brown , Liam Girdwood Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, devicetree , linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org, Hans de Goede List-Id: devicetree@vger.kernel.org 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 --- 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 679018c..4250b1b 100644 --- a/drivers/regulator/axp20x-regulator.c +++ b/drivers/regulator/axp20x-regulator.c @@ -421,6 +421,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.2 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html