diff mbox series

pinctrl: sunxi: do not print error message for EPROBE_DEFER

Message ID 20220217131737.10931-1-mans@mansr.com
State New
Headers show
Series pinctrl: sunxi: do not print error message for EPROBE_DEFER | expand

Commit Message

Måns Rullgård Feb. 17, 2022, 1:17 p.m. UTC
Avoid printing an error message if getting a regulator fails with
EPROBE_DEFER.  This can happen if, for example, a regulator supplying
one of the main banks is controlled by a PL pin.

Signed-off-by: Mans Rullgard <mans@mansr.com>
---
 drivers/pinctrl/sunxi/pinctrl-sunxi.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Comments

Chen-Yu Tsai Feb. 17, 2022, 3:38 p.m. UTC | #1
On Thu, Feb 17, 2022 at 9:19 PM Mans Rullgard <mans@mansr.com> wrote:
>
> Avoid printing an error message if getting a regulator fails with
> EPROBE_DEFER.  This can happen if, for example, a regulator supplying
> one of the main banks is controlled by a PL pin.
>
> Signed-off-by: Mans Rullgard <mans@mansr.com>

Acked-by: Chen-Yu Tsai <wens@csie.org>
Linus Walleij Feb. 19, 2022, 1:09 a.m. UTC | #2
On Thu, Feb 17, 2022 at 2:18 PM Mans Rullgard <mans@mansr.com> wrote:

> Avoid printing an error message if getting a regulator fails with
> EPROBE_DEFER.  This can happen if, for example, a regulator supplying
> one of the main banks is controlled by a PL pin.
>
> Signed-off-by: Mans Rullgard <mans@mansr.com>

Patch applied, thanks!

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
index e42a3a0005a7..534c42ee0718 100644
--- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
@@ -777,11 +777,10 @@  static int sunxi_pmx_request(struct pinctrl_dev *pctldev, unsigned offset)
 
 	snprintf(supply, sizeof(supply), "vcc-p%c", 'a' + bank);
 	reg = regulator_get(pctl->dev, supply);
-	if (IS_ERR(reg)) {
-		dev_err(pctl->dev, "Couldn't get bank P%c regulator\n",
-			'A' + bank);
-		return PTR_ERR(reg);
-	}
+	if (IS_ERR(reg))
+		return dev_err_probe(pctl->dev, PTR_ERR(reg),
+				     "Couldn't get bank P%c regulator\n",
+				     'A' + bank);
 
 	ret = regulator_enable(reg);
 	if (ret) {