diff options
author | H. Nikolaus Schaller <hns@goldelico.com> | 2020-02-17 14:38:15 +0100 |
---|---|---|
committer | Chanwoo Choi <cw00.choi@samsung.com> | 2020-03-25 08:16:13 +0900 |
commit | 3426ad6d40ae5f46b4d75f1e0342565444e52f5f (patch) | |
tree | 8bfd78804d1dd428702b515ec92486c9194da950 /drivers/extcon | |
parent | 1d2790470349ef7c32c6e895d8a13086152a2d9e (diff) | |
download | linux-3426ad6d40ae5f46b4d75f1e0342565444e52f5f.tar.gz linux-3426ad6d40ae5f46b4d75f1e0342565444e52f5f.tar.bz2 linux-3426ad6d40ae5f46b4d75f1e0342565444e52f5f.zip |
extcon: palmas: Hide error messages if gpio returns -EPROBE_DEFER
If the gpios are probed after this driver (e.g. if they
come from an i2c expander) there is no need to print an
error message.
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/extcon')
-rw-r--r-- | drivers/extcon/extcon-palmas.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/extcon/extcon-palmas.c b/drivers/extcon/extcon-palmas.c index edc5016f46f1..cea58d0cb457 100644 --- a/drivers/extcon/extcon-palmas.c +++ b/drivers/extcon/extcon-palmas.c @@ -205,14 +205,18 @@ static int palmas_usb_probe(struct platform_device *pdev) palmas_usb->id_gpiod = devm_gpiod_get_optional(&pdev->dev, "id", GPIOD_IN); - if (IS_ERR(palmas_usb->id_gpiod)) { + if (PTR_ERR(palmas_usb->id_gpiod) == -EPROBE_DEFER) { + return -EPROBE_DEFER; + } else if (IS_ERR(palmas_usb->id_gpiod)) { dev_err(&pdev->dev, "failed to get id gpio\n"); return PTR_ERR(palmas_usb->id_gpiod); } palmas_usb->vbus_gpiod = devm_gpiod_get_optional(&pdev->dev, "vbus", GPIOD_IN); - if (IS_ERR(palmas_usb->vbus_gpiod)) { + if (PTR_ERR(palmas_usb->vbus_gpiod) == -EPROBE_DEFER) { + return -EPROBE_DEFER; + } else if (IS_ERR(palmas_usb->vbus_gpiod)) { dev_err(&pdev->dev, "failed to get vbus gpio\n"); return PTR_ERR(palmas_usb->vbus_gpiod); } |