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]
Date:	Tue, 18 Mar 2014 15:06:00 +0900
From:	Chanwoo Choi <cw00.choi@...sung.com>
To:	sre@...g0.de
Cc:	dbaryshkov@...il.com, dwmw2@...radead.org,
	myungjoo.ham@...sung.com, kyungmin.park@...sung.com,
	linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 0/4] power_supply: Add DT helper function to get
 power-supply dev from dt

Hi Sebastian,

On 03/18/2014 09:38 AM, sre@...g0.de wrote:
> Hi,
> 
> On Mon, Mar 17, 2014 at 09:43:43PM +0900, Chanwoo Choi wrote:
>> This patchset add DT helper function to get power-supply device from devicetree.
>> - of_power_supply_get_dev(struct device *dev, enum power_supply_dev_type type,
>> 			  int index)
>> Power-supply class provides 'power_supply_get_by_name()' to users who want to
>> find power-supply device with the name of power-supply device.
>>
>> If CONFIG_OF is enabled, device drivers which want to get power-supply device
>> would directly get the power-supply device from devicetree by using of_power_
>> supply_get_dev(). This function can be used instead of power_supply_get_by_name().
>>
>> For example,
>> [...]
> 
> include/linux/power_supply.h provides the following function already:
> 
> struct power_supply *
> power_supply_get_by_phandle(struct device_node *np, const char *property);
> 

I checked power_supply_get_by_phandle().
But power_supply_get_by_phandle() is different from of_power_supply_get_dev()

So, I expalin the difference between "power_supply_get_by_phandle()" and "of_power_supply_get_dev()".

Existing "power_supply_get_by_phandle()"
- Need correct the name of power_supply property.
some device driver using power_supply_get_by_phandle() has the dependecy of 
the name of power_supply property.

If the name of power_supply property is modified,
have to modify some device driver using power_supply_get_by_phandle().

But,
Proposed "of_power_supply_get_dev()"
- of_power_supply_get_dev() has not dependency of specific name.
of_power_supply_get_dev() only need device type of power_supply device among following device type:
	"fuelgague"
	"charger"
	we can do addtional device type of power_supply device.

If some device driver use of_poewr_supply_get_dev(),
don't need to consider the name of power_supply device.	

Thanks,
Chanwoo Choi






--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ