public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Laxman Dewangan <ldewangan@nvidia.com>
To: Stephen Warren <swarren@wwwdotorg.org>
Cc: "broonie@opensource.wolfsonmicro.com" 
	<broonie@opensource.wolfsonmicro.com>,
	"sameo@linux.intel.com" <sameo@linux.intel.com>,
	"lrg@ti.com" <lrg@ti.com>,
	"swarren@wwwdotorg.com" <swarren@wwwdotorg.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] regulator: tps6586x: register regulator even if no init data
Date: Tue, 28 Aug 2012 20:26:38 +0530	[thread overview]
Message-ID: <503CDC26.2030701@nvidia.com> (raw)
In-Reply-To: <503CD31E.6050207@wwwdotorg.org>

On Tuesday 28 August 2012 07:48 PM, Stephen Warren wrote:
>
>>
>> -		if ((devs[j].id == TPS6586X_ID_LDO_5) ||
>> -			(devs[j].id == TPS6586X_ID_LDO_RTC))
>> -			reg_idata->supply_regulator = sys_rail_name;
>> +		if (tps6586x_matches[i].init_data) {
> The variable that's being used inside this block is reg_idata.
> Admittedly the value of that variable is tps6586x_matches[i].init_data,
> but I think it'd be much cleaner if the if statement checked reg_idata
> directly; that way, someone reading the code wouldn't have to look above
> to find out that reg_idata and tps6586x_matches[i].init_data are related.
>

OK, will take care in my next patch.


>> +			if (devs[j].id == TPS6586X_ID_SYS)
>> +				sys_rail_name = reg_idata->constraints.name;
> In the MAX8907 patch this attempts to duplicate; if there is no init
> data where the user gives an explicit name, the name from the descriptor
> is used:
>
> if (idata&&  idata->constraints.name)
>      mbatt_rail_name = idata->constraints.name;
> else
>      mbatt_rail_name = pmic->desc[i].name;
>
> Shouldn't that same algorithm be used here?

the desc is not available here in mfd file and so not possible. Each 
regulator register as different platform driver and hence does not have 
the other instance platform data.
However, this will be get fixed once my next patch for moving the dt 
parsing from mfd core to regulator is there. At that time I will take 
care of this.

>>
>> +	if (!pdev->dev.platform_data)
>> +		return 0;
>> +
>>   	return tps6586x_regulator_set_slew_rate(pdev);
>>   }
> Sorry, I don't immediately see why that's related?
The function tps6586x_regulator_set_slew_rate() use the platform data 
which is not available if init_data is not provided by platform.


      reply	other threads:[~2012-08-28 15:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-28 10:29 [PATCH] regulator: tps6586x: register regulator even if no init data Laxman Dewangan
2012-08-28 10:29 ` [PATCH] regulator: tps65910: " Laxman Dewangan
2012-08-28 14:18 ` [PATCH] regulator: tps6586x: " Stephen Warren
2012-08-28 14:56   ` Laxman Dewangan [this message]

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=503CDC26.2030701@nvidia.com \
    --to=ldewangan@nvidia.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@ti.com \
    --cc=sameo@linux.intel.com \
    --cc=swarren@wwwdotorg.com \
    --cc=swarren@wwwdotorg.org \
    /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