From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757891Ab3IBBNs (ORCPT ); Sun, 1 Sep 2013 21:13:48 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:24030 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754780Ab3IBBNq (ORCPT ); Sun, 1 Sep 2013 21:13:46 -0400 X-AuditID: cbfee68d-b7fe86d0000077a5-7f-5223e6480982 Message-id: <5223E648.7020207@samsung.com> Date: Mon, 02 Sep 2013 10:13:44 +0900 From: Chanwoo Choi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-version: 1.0 To: Greg KH Cc: linux-kernel@vger.kernel.org, myungjoo.ham@samsung.com, kyungmin.park@samsung.com, Graeme Gregory , Kishon Vijay Abraham I , Charles Keepax , Mark Brown Subject: Re: [PATCH 3/3] extcon: Simplify extcon_dev_register() prototype by removing unnecessary parameter References: <1378081208-20274-1-git-send-email-cw00.choi@samsung.com> <1378081208-20274-4-git-send-email-cw00.choi@samsung.com> <20130902004024.GB10709@kroah.com> In-reply-to: <20130902004024.GB10709@kroah.com> Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrDIsWRmVeSWpSXmKPExsWyRsSkRNfjmXKQweGLxhZTHz5hs/g35Qa7 Rf8WF4vmxevZLC487WGzONv0ht3i8q45bBa3G1ewOXB4bFrVyeaxf+4ado+XE3+zefRtWcXo MXXKX0aP4ze2M3l83iQXwB7FZZOSmpNZllqkb5fAlXFjdi9TwVTeisOff7A3MD7h6mLk5JAQ MJGYevUVO4QtJnHh3nq2LkYuDiGBpYwSV59MZYIp+rrwADtEYhGjxPuvm8E6hAReMUp8vxUE YvMKaEnsej6VsYuRg4NFQFWia18YSJgNKLz/xQ02EFtUIExi5fQrLBDlghI/Jt8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YkFxQnpeca6hUn5haX5qXrJefn bmIER/wzqR2MKxssDjEKcDAq8fBWrFAOEmJNLCuuzD3EKMHBrCTCa/wEKMSbklhZlVqUH19U mpNafIgxGRgCE5mlRJPzgckoryTe0NjEzMjSyNzQwsjYnDRhJXHeA63WgUIC6YklqdmpqQWp RTBbmDg4pRoYp6vejM9acU5sXdUHS4s60asccpdm+8ZvjriV/XzfQkG9DQV+PtFXg2dezEl/ bWpc0vFrjav/xtLnf9dUd0Uv1ZVcrlfaG2irbzDVMPFYR1LMyRnfs2VLt3Hvb6yMf6twSePO bMPKd4d1TRVsrTqDrq5ddnzmrHTHv9VmF4658ly8JWbde+aGEktxRqKhFnNRcSIAnlIyeDwD AAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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