public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chanwoo Choi <cw00.choi@samsung.com>
To: sre@ring0.de
Cc: dbaryshkov@gmail.com, dwmw2@infradead.org,
	myungjoo.ham@samsung.com, kyungmin.park@samsung.com,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 0/4] power_supply: Add DT helper function to get power-supply dev from dt
Date: Tue, 18 Mar 2014 15:06:00 +0900	[thread overview]
Message-ID: <5327E248.7040706@samsung.com> (raw)
In-Reply-To: <20140318003818.GA17391@earth.universe>

Hi Sebastian,

On 03/18/2014 09:38 AM, sre@ring0.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







  parent reply	other threads:[~2014-03-18  6:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-17 12:43 [RFC PATCH 0/4] power_supply: Add DT helper function to get power-supply dev from dt Chanwoo Choi
2014-03-17 12:43 ` [RFC PATCH 1/4] power_supply: of: Add an API to get power_supply device from dt node Chanwoo Choi
2014-03-17 12:43 ` [RFC PATCH 2/4] charger-manager: Get power_supply device using of_power_supply_get_dev() Chanwoo Choi
2014-03-17 12:43 ` [RFC PATCH 3/4] Documentation: dt: charger-manager: Change the way to get fuel-gauge power-supply device Chanwoo Choi
2014-03-17 12:43 ` [RFC PATCH 4/4] max17042_battery: Change battery name instead of static name according to device type Chanwoo Choi
2014-03-18  0:38 ` [RFC PATCH 0/4] power_supply: Add DT helper function to get power-supply dev from dt sre
2014-03-18  1:25   ` Chanwoo Choi
2014-03-18  6:06   ` Chanwoo Choi [this message]
2014-03-18 15:01     ` sre

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=5327E248.7040706@samsung.com \
    --to=cw00.choi@samsung.com \
    --cc=dbaryshkov@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=sre@ring0.de \
    /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