All of lore.kernel.org
 help / color / mirror / Atom feed
From: florian.vaussard@epfl.ch (Florian Vaussard)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] mfd: twl4030-power: Start transition to DT
Date: Tue, 18 Jun 2013 10:55:03 +0200	[thread overview]
Message-ID: <51C02067.4000302@epfl.ch> (raw)
In-Reply-To: <20130618000211.GC7998@zurbaran>

Hello,

On 06/18/2013 02:02 AM, Samuel Ortiz wrote:
> Hi Florian,
>
> On Thu, May 30, 2013 at 03:51:55PM +0200, Florian Vaussard wrote:
>>   int twl4030_power_probe(struct platform_device *pdev)
>>   {
>>   	struct twl4030_power_data *pdata = pdev->dev.platform_data;
>> +	struct device_node *node = pdev->dev.of_node;
>>   	int err = 0;
>> -	int i;
>> -	struct twl4030_resconfig *resconfig;
>> -	u8 val, address = twl4030_start_script_address;
>> +	u8 val;
>> +
>> +	if (!pdata && !node) {
>> +		dev_err(&pdev->dev, "Platform data is missing\n");
>> +		return -EINVAL;
>> +	}
>>
>>   	err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, TWL4030_PM_MASTER_KEY_CFG1,
>>   			       TWL4030_PM_MASTER_PROTECT_KEY);
>> @@ -525,26 +575,17 @@ int twl4030_power_probe(struct platform_device *pdev)
>>   	if (err)
>>   		goto unlock;
>>
>> -	for (i = 0; i < pdata->num; i++) {
>> -		err = load_twl4030_script(pdata->scripts[i], address);
>> +	if (pdata) {
>> +		err = twl4030_power_configure_scripts(pdata);
>>   		if (err)
>>   			goto load;
>> -		address += pdata->scripts[i]->size;
>> -	}
>> -
>> -	resconfig = pdata->resource_config;
>> -	if (resconfig) {
>> -		while (resconfig->resource) {
>> -			err = twl4030_configure_resource(resconfig);
>> -			if (err)
>> -				goto resource;
>> -			resconfig++;
>> -
>> -		}
>> +		err = twl4030_power_configure_resources(pdata);
>> +		if (err)
>> +			goto resource;
> You're simplifying the probe routine here by defining 2
> twl4030_power_configure_* functions. That's good, but it should be a
> separate patch as it's not related to the DT porting effort.
>

I agree. I will post a v2 with the changes.

Regards,
Florian

WARNING: multiple messages have this Message-ID (diff)
From: Florian Vaussard <florian.vaussard@epfl.ch>
To: Samuel Ortiz <sameo@linux.intel.com>
Cc: Grant Likely <grant.likely@linaro.org>,
	Rob Herring <rob.herring@calxeda.com>,
	Rob Landley <rob@landley.net>,
	Peter Ujfalusi <peter.ujfalusi@ti.com>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Tero Kristo <t-kristo@ti.com>,
	devicetree-discuss@lists.ozlabs.org,
	linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] mfd: twl4030-power: Start transition to DT
Date: Tue, 18 Jun 2013 10:55:03 +0200	[thread overview]
Message-ID: <51C02067.4000302@epfl.ch> (raw)
In-Reply-To: <20130618000211.GC7998@zurbaran>

Hello,

On 06/18/2013 02:02 AM, Samuel Ortiz wrote:
> Hi Florian,
>
> On Thu, May 30, 2013 at 03:51:55PM +0200, Florian Vaussard wrote:
>>   int twl4030_power_probe(struct platform_device *pdev)
>>   {
>>   	struct twl4030_power_data *pdata = pdev->dev.platform_data;
>> +	struct device_node *node = pdev->dev.of_node;
>>   	int err = 0;
>> -	int i;
>> -	struct twl4030_resconfig *resconfig;
>> -	u8 val, address = twl4030_start_script_address;
>> +	u8 val;
>> +
>> +	if (!pdata && !node) {
>> +		dev_err(&pdev->dev, "Platform data is missing\n");
>> +		return -EINVAL;
>> +	}
>>
>>   	err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, TWL4030_PM_MASTER_KEY_CFG1,
>>   			       TWL4030_PM_MASTER_PROTECT_KEY);
>> @@ -525,26 +575,17 @@ int twl4030_power_probe(struct platform_device *pdev)
>>   	if (err)
>>   		goto unlock;
>>
>> -	for (i = 0; i < pdata->num; i++) {
>> -		err = load_twl4030_script(pdata->scripts[i], address);
>> +	if (pdata) {
>> +		err = twl4030_power_configure_scripts(pdata);
>>   		if (err)
>>   			goto load;
>> -		address += pdata->scripts[i]->size;
>> -	}
>> -
>> -	resconfig = pdata->resource_config;
>> -	if (resconfig) {
>> -		while (resconfig->resource) {
>> -			err = twl4030_configure_resource(resconfig);
>> -			if (err)
>> -				goto resource;
>> -			resconfig++;
>> -
>> -		}
>> +		err = twl4030_power_configure_resources(pdata);
>> +		if (err)
>> +			goto resource;
> You're simplifying the probe routine here by defining 2
> twl4030_power_configure_* functions. That's good, but it should be a
> separate patch as it's not related to the DT porting effort.
>

I agree. I will post a v2 with the changes.

Regards,
Florian

  reply	other threads:[~2013-06-18  8:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-30 13:51 [PATCH 0/3] mfd: twl4030-power: Start DT conversion Florian Vaussard
2013-05-30 13:51 ` Florian Vaussard
2013-05-30 13:51 ` [PATCH 1/3] mfd: twl4030-power: Split from twl-core into a dedicated module Florian Vaussard
2013-05-30 13:51   ` Florian Vaussard
2013-06-17 23:56   ` Samuel Ortiz
2013-06-17 23:56     ` Samuel Ortiz
2013-06-18  8:53     ` Florian Vaussard
2013-06-18  8:53       ` Florian Vaussard
2013-05-30 13:51 ` [PATCH 2/3] mfd: twl4030-power: Start transition to DT Florian Vaussard
2013-05-30 13:51   ` Florian Vaussard
2013-05-30 13:51   ` Florian Vaussard
2013-06-18  0:02   ` Samuel Ortiz
2013-06-18  0:02     ` Samuel Ortiz
2013-06-18  8:55     ` Florian Vaussard [this message]
2013-06-18  8:55       ` Florian Vaussard
2013-05-30 13:51 ` [PATCH 3/3] mfd: twl4030-power: Simplify error path Florian Vaussard
2013-05-30 13:51   ` Florian Vaussard
2013-05-30 13:51   ` Florian Vaussard

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=51C02067.4000302@epfl.ch \
    --to=florian.vaussard@epfl.ch \
    --cc=linux-arm-kernel@lists.infradead.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 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.