On Thu, Dec 05, 2013 at 07:28:09PM +0100, Denis Carikli wrote: [...] > diff --git a/drivers/staging/imx-drm/parallel-display.c b/drivers/staging/imx-drm/parallel-display.c [...] > @@ -260,6 +275,13 @@ static int imx_pd_probe(struct platform_device *pdev) > if (ret) > return ret; > > + imxpd->disp_reg = devm_regulator_get(&pdev->dev, "display"); > + if (PTR_ERR(imxpd->disp_reg) == -EPROBE_DEFER) > + return -EPROBE_DEFER; > + > + if (IS_ERR(imxpd->disp_reg)) > + dev_dbg(&pdev->dev, "Operating without display regulator.\n"); I don't think this is necessary. There is code in the regulator core nowadays that supplies a dummy regulator if one hasn't been hooked up in devicetree explicitly. So any error that you get at this point is likely a valid one rather than just a missing regulator. The advantage is that you no longer have to check at every step of the way that the regulator is valid before calling the regulator API. Thierry
Attachment:
pgpyIag7dC9u8.pgp
Description: PGP signature