All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chanwoo Choi <cw00.choi@samsung.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, myungjoo.ham@samsung.com,
	kyungmin.park@samsung.com, Graeme Gregory <gg@slimlogic.co.uk>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Charles Keepax <ckeepax@opensource.wolfsonmicro.com>,
	Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH 3/3] extcon: Simplify extcon_dev_register() prototype by removing unnecessary parameter
Date: Mon, 02 Sep 2013 10:13:44 +0900	[thread overview]
Message-ID: <5223E648.7020207@samsung.com> (raw)
In-Reply-To: <20130902004024.GB10709@kroah.com>

Hi Greg,

On 09/02/2013 09:40 AM, Greg KH wrote:
> On Mon, Sep 02, 2013 at 09:20:08AM +0900, Chanwoo Choi wrote:
>> This patch remove extcon_dev_register()'s second parameter which means
>> the pointer of parent device to simplify prototype of this function.
> 
> No, please don't.  You want the parent to be passed in, as the core
> needs it when it is registered with the system, otherwise it will not
> show up in sysfs properly (i.e. you can't set it afterwards.)

Currently, each extcon driver have allocated memory for extcon device
by using devm_kzalloc() in each extcon device driver.So,I have plan to
implement "devm_extcon_allocate_device()" which allocate managed extcon device
and connect with parent device(->dev.parent = dev).
(I refer to devm_input_allocate_device() in drivers/input/input.c)

So, This patch is precedence work before implementing devm_extcon_allocate_device()
because the pointer of parent device have to pass devm_extcon_allocate_device()
instead of extcon_dev_register().

I'm going to change registration prcedure for extcon device as following:
Before:
	ret = extcon_dev_register(edev, dev);

After:
	edev = devm_extcon_allocate_device(dev);
	...
	ret = extcon_dev_register(edev);
	...


If you want me to send this feature including in 'devm_extcon_allocate_device()'
at the same time, I'll complete this feature and then post this patchset again.

> 
>> So, if extcon device has the parent device, it should set the pointer of
>> parent device to edev.dev.parent in extcon device driver instead of in
>> extcon_dev_register().
> 
> No it will break things if you do that :(

Best Regards,
Chanwoo Choi

  reply	other threads:[~2013-09-02  1:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-02  0:20 [PATCH 0/3] extcon: Code clean to fix up coding style and remove Chanwoo Choi
2013-09-02  0:20 ` [PATCH 1/3] extcon: Fix indentation coding style to improve readability Chanwoo Choi
2013-09-02  0:20 ` [PATCH 2/3] extcon: Change field type of 'dev' in extcon_dev structure Chanwoo Choi
2013-09-02  0:38   ` Greg KH
2013-09-02  0:41     ` Chanwoo Choi
2013-09-02  0:20 ` [PATCH 3/3] extcon: Simplify extcon_dev_register() prototype by removing unnecessary parameter Chanwoo Choi
2013-09-02  0:40   ` Greg KH
2013-09-02  1:13     ` Chanwoo Choi [this message]
2013-09-03 15:57       ` Greg KH
2013-09-04  0:17         ` Chanwoo Choi
2013-09-04  1:16           ` Greg KH
2013-09-04  5:18             ` Chanwoo Choi
2013-09-08 21:51               ` Greg KH
2013-09-09  2:44                 ` Chanwoo Choi

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=5223E648.7020207@samsung.com \
    --to=cw00.choi@samsung.com \
    --cc=broonie@kernel.org \
    --cc=ckeepax@opensource.wolfsonmicro.com \
    --cc=gg@slimlogic.co.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=kishon@ti.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=myungjoo.ham@samsung.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.