mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: atull <atull@opensource.altera.com>, Mark Brown <broonie@kernel.org>
Cc: jdelvare@suse.de, lm-sensors@lm-sensors.org, lgirdwood@gmail.com,
	linux-kernel@vger.kernel.org, delicious.quinoa@gmail.com,
	dinguyen@opensource.altera.com, yvanderv@opensource.altera.com
Subject: Re: [PATCH v2 1/2] pmbus: add regulator support
Date: Sat, 23 Aug 2014 07:00:44 -0700	[thread overview]
Message-ID: <53F89E8C.3070200@roeck-us.net> (raw)
In-Reply-To: <alpine.DEB.2.10.1408221927370.2334@shineypoop>

On 08/22/2014 05:31 PM, atull wrote:
> On Fri, 22 Aug 2014, Mark Brown wrote:
>
>> On Fri, Aug 22, 2014 at 04:11:33PM -0500, atull@opensource.altera.com wrote:
>>
>>> +	if (pdata && pdata->reg_init_data) {
>>> +		config.init_data = pdata->reg_init_data;
>>> +	} else {
>>> +		config.init_data = of_get_regulator_init_data(dev, np);
>>> +		if (!config.init_data)
>>> +			return -ENOMEM;
>>> +	}
>>
>> It should be fine to start with no init data - just let the regulator
>> core worry about it.  This will allow users to read back the state even
>> if they can't change anything which is useful for system bringup or
>> general debugging.
>>
>
> of_get_regulator_init_data() will only have an error if it cannot alloc
> the regulator_init_data struct.  That's why I did -ENOMEM.  If there
> is no platform data and nothing about the regulator in the device tree, we
> should end up with a zeroed out regulator_init_data.
>
Yes, but if OF is not defined it will return NULL as well. Unless I am
missing something, that means that the code will now fail if there is
no platform init data and OF is not configured.

Guenter


  reply	other threads:[~2014-08-23 14:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-22 21:11 [PATCH v2 0/2] dd regulator support for pmbus and ltc2978 atull
2014-08-22 21:11 ` [PATCH v2 1/2] pmbus: add regulator support atull
2014-08-22 21:44   ` Mark Brown
2014-08-23  0:31     ` atull
2014-08-23 14:00       ` Guenter Roeck [this message]
2014-08-23 14:54         ` Mark Brown
2014-08-24  0:48           ` Alan Tull
2014-08-22 21:11 ` [PATCH v2 2/2] pmbus: ltc2978: add regulator gating atull
2014-08-22 21:45   ` Mark Brown
2014-08-23 15:10     ` Guenter Roeck
2014-08-23 15:53       ` Mark Brown
2014-08-24 13:30       ` Alan Tull
2014-08-25 17:02         ` Guenter Roeck

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=53F89E8C.3070200@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=atull@opensource.altera.com \
    --cc=broonie@kernel.org \
    --cc=delicious.quinoa@gmail.com \
    --cc=dinguyen@opensource.altera.com \
    --cc=jdelvare@suse.de \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.org \
    --cc=yvanderv@opensource.altera.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

Powered by JetHome