drm/panel: simple: Skip error message on deferred probe
authorFabio Estevam <fabio.estevam@nxp.com>
Fri, 30 Jun 2017 21:14:46 +0000 (18:14 -0300)
committerThierry Reding <treding@nvidia.com>
Fri, 18 Aug 2017 15:10:43 +0000 (17:10 +0200)
When enable_gpio is provided via an I2C or SPI expander, it may not be
available when panel-simple probes leading to the following error:

panel-simple panel: failed to request GPIO: -517

As this error message is not very useful to the end user, skip printing
it in the case of deferred probe.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1498857286-10820-1-git-send-email-festevam@gmail.com
drivers/gpu/drm/panel/panel-simple.c

index 474fa759e06ec5510661c164860b19cdefae64a7..9469c4d72a4298de85fc9e0cc3dce44f29830792 100644 (file)
@@ -315,7 +315,8 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
                                                     GPIOD_OUT_LOW);
        if (IS_ERR(panel->enable_gpio)) {
                err = PTR_ERR(panel->enable_gpio);
-               dev_err(dev, "failed to request GPIO: %d\n", err);
+               if (err != -EPROBE_DEFER)
+                       dev_err(dev, "failed to request GPIO: %d\n", err);
                return err;
        }