devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Cc: devicetree@vger.kernel.org, drinkcat@chromium.org,
	Emil Velikov <emil.l.velikov@gmail.com>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	robh+dt@kernel.org, treding@nvidia.com, dan.carpenter@oracle.com
Subject: Re: [RESEND PATCH v4 4/4] drm: bridge: anx78xx: Add anx78xx driver support.
Date: Mon, 2 May 2016 16:22:15 +0200	[thread overview]
Message-ID: <20160502142215.GA10348@ulmo.ba.sec> (raw)
In-Reply-To: <1462175666-8891-5-git-send-email-enric.balletbo@collabora.com>


[-- Attachment #1.1: Type: text/plain, Size: 1541 bytes --]

On Mon, May 02, 2016 at 09:54:26AM +0200, Enric Balletbo i Serra wrote:
[...]
> diff --git a/drivers/gpu/drm/bridge/analogix-anx78xx.c b/drivers/gpu/drm/bridge/analogix-anx78xx.c
[...]
> +static int anx78xx_init_pdata(struct anx78xx *anx78xx)
> +{
> +	struct device *dev = &anx78xx->client->dev;
> +	struct anx78xx_platform_data *pdata = &anx78xx->pdata;
> +
> +	/* 1.0V digital core power regulator (optional) */
> +	pdata->dvdd10 = devm_regulator_get(dev, "dvdd10");
> +	if (IS_ERR(pdata->dvdd10)) {
> +		DRM_INFO("DVDD10 regulator not found\n");
> +		pdata->dvdd10 = NULL;
> +	}

I'm almost sure that this isn't what you want. What if the regulator is
hooked up but the bridge driver probes before the regulator. I think
what you really want is to simply propagate the error code via:

	return PTR_ERR(pdata->dvdd10);

My understanding is that the regulator core will give you a dummy one if
there's really nothing hooked up. I think you're also supposed to call
regulator_get_optional() (or the devm_*() equivalent) if this is truly
an optional supply. Given that it's the "core power" regulator I doubt
that it's really optional; it's more likely that you may not be able to
control it, and that it's therefore always on. In that case you're
supposed to model it in DT as a fixed regulator that's always on.

This is fairly minor and it's really the only thing I could find, so no
need to respin just for that. If you're fine with the above solution (to
propagate the error code) I can make the change manually while applying.

Thierry

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-05-02 14:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-02  7:54 [RESEND PATCH v4 0/4] Add ANX7814 I2C bridge driver Enric Balletbo i Serra
     [not found] ` <1462175666-8891-1-git-send-email-enric.balletbo-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2016-05-02  7:54   ` [RESEND PATCH v4 1/4] drm/dp: Add define to set 0.5% down-spread in MAX_DOWNSPREAD register Enric Balletbo i Serra
2016-05-02  7:54   ` [RESEND PATCH v4 2/4] of: Add vendor prefix for Analogix Semiconductor Enric Balletbo i Serra
2016-05-02  7:54   ` [RESEND PATCH v4 3/4] devicetree: Add ANX7814 SlimPort transmitter binding Enric Balletbo i Serra
2016-05-02  7:54 ` [RESEND PATCH v4 4/4] drm: bridge: anx78xx: Add anx78xx driver support Enric Balletbo i Serra
2016-05-02 14:22   ` Thierry Reding [this message]
2016-05-02 15:22     ` Enric Balletbo Serra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160502142215.GA10348@ulmo.ba.sec \
    --to=thierry.reding@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=drinkcat@chromium.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=enric.balletbo@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=treding@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).