The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: atull <atull@opensource.altera.com>
To: Mark Brown <broonie@kernel.org>
Cc: <linux@roeck-us.net>, <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: Fri, 22 Aug 2014 19:31:12 -0500	[thread overview]
Message-ID: <alpine.DEB.2.10.1408221927370.2334@shineypoop> (raw)
In-Reply-To: <20140822214417.GC24407@sirena.org.uk>

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.

Thanks for the review.

Alan

  reply	other threads:[~2014-08-23  0:31 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 [this message]
2014-08-23 14:00       ` Guenter Roeck
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=alpine.DEB.2.10.1408221927370.2334@shineypoop \
    --to=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=linux@roeck-us.net \
    --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