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] [thread-next>] [day] [month] [year] [list]
Message-Id: <20110413104402.d0115659.ospite@studenti.unina.it>
Date:	Wed, 13 Apr 2011 10:44:02 +0200
From:	Antonio Ospite <ospite@...denti.unina.it>
To:	Johannes Berg <johannes@...solutions.net>
Cc:	linux-wireless@...r.kernel.org, openezx-devel@...ts.openezx.org,
	"John W . Linville" <linville@...driver.com>,
	Mark Brown <broonie@...nsource.wolfsonmicro.com>,
	linux-kernel@...r.kernel.org, Marek Vasut <marek.vasut@...il.com>,
	Guiming Zhuo <gmzhuo@...il.com>
Subject: Re: [PATCH v2] rfkill: Regulator consumer driver for rfkill

On Tue, 12 Apr 2011 13:44:02 +0200
Johannes Berg <johannes@...solutions.net> wrote:

> On Tue, 2011-04-12 at 13:41 +0200, Johannes Berg wrote:
> 
> > > + * static struct regulator_consumer_supply pcap_regulator_V6_consumers [] = {
> > > + * 	{ .dev_name = "rfkill-regulator.0", supply = "vrfkill" },
> > > + * };
> > 
> > It's a comment, but it should be .supply = (missing the .)
> >

well spotted, I'll fix this.

> > > +	if (pdata->name == NULL || pdata->type == 0) {
> > > +		dev_err(&pdev->dev, "invalid name or type in platform data\n");
> > > +		return -EINVAL;
> > > +	}
> > > +
> > > +	vcc = regulator_get_exclusive(&pdev->dev, "vrfkill");
> > 
> > Wasn't that supposed to use pdata->supply? Actually, there's no member
> > "supply" in the struct?
> 
> Oh wait, I think I just misunderstood how this works. But if the name is
> "vrfkill" how does that really work with multiple instances?
>

That's how the regulator framework works, I know Mark already replied to
you but I try to elaborate more for the records and to organize my 
thoughts about that:

 - In the consumers for the regulator we choose the virtual supply,
   "vrfkill" in this case, and which driver is going to use it.

 - Wrt. to multiple instances, they are distinguished using device ids.

   When we set consumers for a physical regulator we can tell: device
   "rfkill-regulator.1" will call this regulator "vrfkill" and we
   declare the relative rfkill-regulator platform device with .id=1,
   this way the regulator framework knows what physical regulator to
   return when asked for vrfkill _from_ a rfkill-regulator platform
   device instance with .id==1

I hope I am not introducing any inaccuracies :)

A v3 of the patch is on its way.

Thanks,
   Antonio

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ