[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <52267BFE.3030106@samsung.com>
Date: Wed, 04 Sep 2013 09:17:02 +0900
From: Chanwoo Choi <cw00.choi@...sung.com>
To: Greg KH <gregkh@...uxfoundation.org>
Cc: linux-kernel@...r.kernel.org, myungjoo.ham@...sung.com,
kyungmin.park@...sung.com, Graeme Gregory <gg@...mlogic.co.uk>,
Kishon Vijay Abraham I <kishon@...com>,
Charles Keepax <ckeepax@...nsource.wolfsonmicro.com>,
Mark Brown <broonie@...nel.org>
Subject: Re: [PATCH 3/3] extcon: Simplify extcon_dev_register() prototype by
removing unnecessary parameter
On 09/04/2013 12:57 AM, Greg KH wrote:
> On Mon, Sep 02, 2013 at 10:13:44AM +0900, Chanwoo Choi wrote:
>> 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.
>
> That seems backwards, the extcon core should be the one doing the
> allocation, and ownership of the device, like all other subsystem cores
> do. That makes the driver logic much simpler, and the lifetime
> ownership correct (i.e. what happens when a device is unbound from a
> driver by userspace? The driver can't control the device memory
> anymore...)
>
OK,
The extcon core will control memory allocation instead of extcon device driver
as following.
- devm_extcon_allocate_device(struct device *dev)
I'll complete this feature about memory allocation for extcon device
and resend it again. Thanks.
Best Regards,
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