lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 15 Jul 2013 16:09:28 +0100
From:	Mark Brown <broonie@...nel.org>
To:	Robin Gong <b38343@...escale.com>
Cc:	linux-kernel@...r.kernel.org, grant.likely@...aro.org,
	rob.herring@...xeda.com, lgirdwood@...il.com, shawn.guo@...aro.org,
	devicetree-discuss@...ts.ozlabs.org, linux-doc@...r.kernel.org,
	rob@...dley.net
Subject: Re: [PATCH v2] regulator: pfuze100: add pfuze100 regulator driver

On Sat, Jul 13, 2013 at 12:15:12AM +0800, Robin Gong wrote:

Please fix your mail program to word wrap between paragraphs.

> On Fri, Jul 12, 2013 at 03:40:37PM +0100, Mark Brown wrote:

> > > +static const int pfuze100_swbst[] = {
> > > +	5000000, 5050000, 5100000, 5150000,
> > > +};

> > This looks like a linear map, the steps are all 50mV?

> Yes, but the swbst regulator share the same define type with the vsnvs
> regulator, and the later voltage table is not linear, so I use
> volt_table in swbst regulator . I don't want to  add another regulator
> type for this.

You should do so; it's not hard.

> > You should just register all the regulators rather than only registering
> > those that the user explicitly selects.  This allows users to inpect the
> > current configuration and simplifies the code - for example you don't
> > need to count the DT nodes and you can just have a simple array in the
> > platform data (see how wm831x does this for an example).

> Yes, it will simplifies the code, but sometimes we will not use all
> the regulators on boards, in this case, Is it better that only
> register the available regulators?

It's better to have everything, that way the framework can do things
like power down unused regualtors that got left enabled.

> > You should really be doing this on a copy of the regulators table rather
> > than on the table itself.

> everyone of the four regulators(SW2~SW4) has two different linear
> voltage table which decided by the specific bit(one regulator ,one
> different bit) . So  will modify the voltage table dynamically before
> regulator register. I think this way is more simple , although looks
> little weird and uncomfortable.

You're missing the point here.  You shouldn't be modifying global data
(which should be marked as const) at all, you should be working on a
copy of it if it needs modifying.

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ