All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: Laxman Dewangan <ldewangan@nvidia.com>
Cc: sameo@linux.intel.com, linux-doc@vger.kernel.org,
	devicetree-discuss@lists.ozlabs.org,
	broonie@opensource.wolfsonmicro.com,
	linux-kernel@vger.kernel.org, rob.herring@calxeda.com
Subject: Re: [PATCH RESEND 2/4] regulator: tps65090: add DT support
Date: Mon, 28 Jan 2013 08:58:26 -0700	[thread overview]
Message-ID: <5106A022.9040909@wwwdotorg.org> (raw)
In-Reply-To: <1359277035-16854-3-git-send-email-ldewangan@nvidia.com>

On 01/27/2013 01:57 AM, Laxman Dewangan wrote:
> Add DT support for TI PMIC tps65090 regulator driver. The DT of this
> device have node regulator and all regulator's node of this device is
> added under this node.
> 
> The device tree binding document has the required information for
> adding this device on DTS file.
> 
> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
> Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

> diff --git a/drivers/regulator/tps65090-regulator.c b/drivers/regulator/tps65090-regulator.c

> @@ -147,15 +228,20 @@ static int tps65090_regulator_probe(struct platform_device *pdev)
>  	struct tps65090_regulator_plat_data *tps_pdata;
>  	struct tps65090_regulator *pmic;
>  	struct tps65090_platform_data *tps65090_pdata;
> +	struct of_regulator_match *tps65090_reg_matches = NULL;
>  	int num;
>  	int ret;
>  
>  	dev_dbg(&pdev->dev, "Probing regulator\n");
>  
>  	tps65090_pdata = dev_get_platdata(pdev->dev.parent);
> -	if (!tps65090_pdata) {
> +	if (!tps65090_pdata && tps65090_mfd->pdata &&
> +			tps65090_mfd->dev->of_node)
> +		tps65090_pdata = tps65090_parse_dt_reg_data(pdev,
> +					&tps65090_reg_matches);

Why check "&& tps65090_mfd->pdata" here; why not always parse DT if
(!tps65090_pdata && tps65090_mfd->dev->of_node)? In that condition, the
parent MFD driver will always have allocated tps65090_mfd->pdata.


> +	if (IS_ERR_OR_NULL(tps65090_pdata)) {
>  		dev_err(&pdev->dev, "Platform data missing\n");
> -		return -EINVAL;
> +		return (tps65090_pdata) ? PTR_ERR(tps65090_pdata) : -EINVAL;

No need for () there.

  reply	other threads:[~2013-01-28 15:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-27  8:57 [PATCH RESEND 0/4] mfd/regulator: tps65090: add DT support and suspend/resume cleanups Laxman Dewangan
2013-01-27  8:57 ` Laxman Dewangan
2013-01-27  8:57 ` [PATCH RESEND 1/4] mfd: tps65090: add DT support for tps65090 Laxman Dewangan
2013-01-27  8:57   ` Laxman Dewangan
2013-01-28 15:52   ` Stephen Warren
2013-01-27  8:57 ` [PATCH RESEND 2/4] regulator: tps65090: add DT support Laxman Dewangan
2013-01-27  8:57   ` Laxman Dewangan
2013-01-28 15:58   ` Stephen Warren [this message]
2013-01-27  8:57 ` [PATCH RESEND 3/4] mfd: tps65090: Pass irq domain when adding mfd sub devices Laxman Dewangan
2013-01-27  8:57   ` Laxman Dewangan
2013-01-27  8:57 ` [PATCH RESEND 4/4] mfd: tps65090: remove suspend/resume callbacks Laxman Dewangan
2013-01-27  8:57   ` Laxman Dewangan

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=5106A022.9040909@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=ldewangan@nvidia.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rob.herring@calxeda.com \
    --cc=sameo@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.