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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 02 Sep 2013 10:13:44 +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

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
--
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