From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chunfeng Yun Subject: Re: [PATCH v2 4/6] usb: roles: add API to get usb_role_switch by node Date: Fri, 15 Mar 2019 17:14:08 +0800 Message-ID: <1552641248.10179.134.camel@mhfsdcap03> References: <1552635513-2378-1-git-send-email-chunfeng.yun@mediatek.com> <1552635513-2378-5-git-send-email-chunfeng.yun@mediatek.com> <20190315081835.GD7752@kuha.fi.intel.com> <20190315091127.GF7752@kuha.fi.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20190315091127.GF7752@kuha.fi.intel.com> Sender: linux-kernel-owner@vger.kernel.org To: Heikki Krogerus Cc: Andy Shevchenko , Rob Herring , Greg Kroah-Hartman , Mark Rutland , Matthias Brugger , Adam Thomson , Li Jun , Badhri Jagan Sridharan , Hans de Goede , Min Guo , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org List-Id: linux-mediatek@lists.infradead.org Hi, On Fri, 2019-03-15 at 11:11 +0200, Heikki Krogerus wrote: > On Fri, Mar 15, 2019 at 10:18:35AM +0200, Heikki Krogerus wrote: > > Andy already pointed out that you need to use fwnodes. > > > > Rule of thumb: You always use fwnodes. Only if there is something that > > can't be done with fwnodes you use DT or ACPI nodes directly. > > > > In this case there is absolutely nothing that would prevent you from > > using fwnodes. > > ... > > > +/** > > + * usb_role_switch_get_by_node - Find USB role switch by it's parent node > > + * @node: The node that register USB role switch > > + * > > + * Finds and returns role switch registered by @node. The reference count > > + * for the found switch is incremented. > > + */ > > +struct usb_role_switch *usb_role_switch_get_by_node(struct device_node *node) > > This is my proposal for function prototype: > > struct usb_role_switch * > fwnode_usb_role_switch_get(struct fwnode_handle *fwnode); Ok, thanks again > > > thanks, > From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Subject: [v2,4/6] usb: roles: add API to get usb_role_switch by node From: Chunfeng Yun Message-Id: <1552641248.10179.134.camel@mhfsdcap03> Date: Fri, 15 Mar 2019 17:14:08 +0800 To: Heikki Krogerus Cc: Andy Shevchenko , Rob Herring , Greg Kroah-Hartman , Mark Rutland , Matthias Brugger , Adam Thomson , Li Jun , Badhri Jagan Sridharan , Hans de Goede , Min Guo , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org List-ID: SGksCk9uIEZyaSwgMjAxOS0wMy0xNSBhdCAxMToxMSArMDIwMCwgSGVpa2tpIEtyb2dlcnVzIHdy b3RlOgo+IE9uIEZyaSwgTWFyIDE1LCAyMDE5IGF0IDEwOjE4OjM1QU0gKzAyMDAsIEhlaWtraSBL cm9nZXJ1cyB3cm90ZToKPiA+IEFuZHkgYWxyZWFkeSBwb2ludGVkIG91dCB0aGF0IHlvdSBuZWVk IHRvIHVzZSBmd25vZGVzLgo+ID4gCj4gPiBSdWxlIG9mIHRodW1iOiBZb3UgYWx3YXlzIHVzZSBm d25vZGVzLiBPbmx5IGlmIHRoZXJlIGlzIHNvbWV0aGluZyB0aGF0Cj4gPiBjYW4ndCBiZSBkb25l IHdpdGggZndub2RlcyB5b3UgdXNlIERUIG9yIEFDUEkgbm9kZXMgZGlyZWN0bHkuCj4gPiAKPiA+ IEluIHRoaXMgY2FzZSB0aGVyZSBpcyBhYnNvbHV0ZWx5IG5vdGhpbmcgdGhhdCB3b3VsZCBwcmV2 ZW50IHlvdSBmcm9tCj4gPiB1c2luZyBmd25vZGVzLgo+IAo+IC4uLgo+IAo+ID4gKy8qKgo+ID4g KyAqIHVzYl9yb2xlX3N3aXRjaF9nZXRfYnlfbm9kZSAtIEZpbmQgVVNCIHJvbGUgc3dpdGNoIGJ5 IGl0J3MgcGFyZW50IG5vZGUKPiA+ICsgKiBAbm9kZTogVGhlIG5vZGUgdGhhdCByZWdpc3RlciBV U0Igcm9sZSBzd2l0Y2gKPiA+ICsgKgo+ID4gKyAqIEZpbmRzIGFuZCByZXR1cm5zIHJvbGUgc3dp dGNoIHJlZ2lzdGVyZWQgYnkgQG5vZGUuIFRoZSByZWZlcmVuY2UgY291bnQKPiA+ICsgKiBmb3Ig dGhlIGZvdW5kIHN3aXRjaCBpcyBpbmNyZW1lbnRlZC4KPiA+ICsgKi8KPiA+ICtzdHJ1Y3QgdXNi X3JvbGVfc3dpdGNoICp1c2Jfcm9sZV9zd2l0Y2hfZ2V0X2J5X25vZGUoc3RydWN0IGRldmljZV9u b2RlICpub2RlKQo+IAo+IFRoaXMgaXMgbXkgcHJvcG9zYWwgZm9yIGZ1bmN0aW9uIHByb3RvdHlw ZToKPiAKPiBzdHJ1Y3QgdXNiX3JvbGVfc3dpdGNoICoKPiBmd25vZGVfdXNiX3JvbGVfc3dpdGNo X2dldChzdHJ1Y3QgZndub2RlX2hhbmRsZSAqZndub2RlKTsKT2ssIHRoYW5rcyBhZ2Fpbgo+IAo+ IAo+IHRoYW5rcywKPgo= From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42CDBC43381 for ; Fri, 15 Mar 2019 09:14:44 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0FF002184C for ; Fri, 15 Mar 2019 09:14:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="H+5Ndv+f" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0FF002184C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5fEpdVtmK2Pi5b+b2ZQFwRUR7AfD8yTljb6t3zgLYdI=; b=H+5Ndv+f/5HwS9 Gtb4qH2yVFDHQ+VyO9PtjV1Rq/Hg1HMIBqbX1E5hvl2VmLhEtiDc8JX49SiJohyRYbQhYAkLH+UlL qpcDE0XWsOK/rL+nN8aWPcRZytn0nTUKVQR0InGIuahufSD+XcGn2whzYJKmTG3kbSBTtSCwBybMO BKIMGy4QVjfZPgn2HvAGfR+TvPqyEcDv3EqFCQnYBK/x031XGe09KnewqJP6w/g16Nc6siKU/1qDK /Nd2Hui4cSZdKC79//1ehy6EZo3FHmHoj2OXC/AR7YHw0k2RH83YJbawy3JAPQl52fFV3qaViXsls iG0+rYHwooXcPczzpBdg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h4ivF-0004aN-Kv; Fri, 15 Mar 2019 09:14:37 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h4ivC-0004ZW-3y; Fri, 15 Mar 2019 09:14:35 +0000 X-UUID: 06c4f0d002db41b9bdbbcd9caf94ee09-20190315 X-UUID: 06c4f0d002db41b9bdbbcd9caf94ee09-20190315 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 667325702; Fri, 15 Mar 2019 01:14:13 -0800 Received: from MTKMBS31N2.mediatek.inc (172.27.4.87) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 15 Mar 2019 02:14:11 -0700 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by MTKMBS31N2.mediatek.inc (172.27.4.87) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 15 Mar 2019 17:14:09 +0800 Received: from [10.17.3.153] (172.27.4.253) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 15 Mar 2019 17:14:08 +0800 Message-ID: <1552641248.10179.134.camel@mhfsdcap03> Subject: Re: [PATCH v2 4/6] usb: roles: add API to get usb_role_switch by node From: Chunfeng Yun To: Heikki Krogerus Date: Fri, 15 Mar 2019 17:14:08 +0800 In-Reply-To: <20190315091127.GF7752@kuha.fi.intel.com> References: <1552635513-2378-1-git-send-email-chunfeng.yun@mediatek.com> <1552635513-2378-5-git-send-email-chunfeng.yun@mediatek.com> <20190315081835.GD7752@kuha.fi.intel.com> <20190315091127.GF7752@kuha.fi.intel.com> X-Mailer: Evolution 3.2.3-0ubuntu6 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190315_021434_158743_C5D8EA94 X-CRM114-Status: GOOD ( 11.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Hans de Goede , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Badhri Jagan Sridharan , Andy Shevchenko , Rob Herring , linux-mediatek@lists.infradead.org, Min Guo , Matthias Brugger , Adam Thomson , linux-arm-kernel@lists.infradead.org, Li Jun Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, On Fri, 2019-03-15 at 11:11 +0200, Heikki Krogerus wrote: > On Fri, Mar 15, 2019 at 10:18:35AM +0200, Heikki Krogerus wrote: > > Andy already pointed out that you need to use fwnodes. > > > > Rule of thumb: You always use fwnodes. Only if there is something that > > can't be done with fwnodes you use DT or ACPI nodes directly. > > > > In this case there is absolutely nothing that would prevent you from > > using fwnodes. > > ... > > > +/** > > + * usb_role_switch_get_by_node - Find USB role switch by it's parent node > > + * @node: The node that register USB role switch > > + * > > + * Finds and returns role switch registered by @node. The reference count > > + * for the found switch is incremented. > > + */ > > +struct usb_role_switch *usb_role_switch_get_by_node(struct device_node *node) > > This is my proposal for function prototype: > > struct usb_role_switch * > fwnode_usb_role_switch_get(struct fwnode_handle *fwnode); Ok, thanks again > > > thanks, > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DFFE5C43381 for ; Fri, 15 Mar 2019 09:14:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B8D162184C for ; Fri, 15 Mar 2019 09:14:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728707AbfCOJOT (ORCPT ); Fri, 15 Mar 2019 05:14:19 -0400 Received: from Mailgw01.mediatek.com ([1.203.163.78]:21571 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727282AbfCOJOT (ORCPT ); Fri, 15 Mar 2019 05:14:19 -0400 X-UUID: dad85c0880044b85b0c26a529b841199-20190315 X-UUID: dad85c0880044b85b0c26a529b841199-20190315 Received: from mtkcas35.mediatek.inc [(172.27.4.253)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 823694479; Fri, 15 Mar 2019 17:14:10 +0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by MTKMBS31N2.mediatek.inc (172.27.4.87) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 15 Mar 2019 17:14:09 +0800 Received: from [10.17.3.153] (172.27.4.253) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 15 Mar 2019 17:14:08 +0800 Message-ID: <1552641248.10179.134.camel@mhfsdcap03> Subject: Re: [PATCH v2 4/6] usb: roles: add API to get usb_role_switch by node From: Chunfeng Yun To: Heikki Krogerus CC: Andy Shevchenko , Rob Herring , Greg Kroah-Hartman , "Mark Rutland" , Matthias Brugger , Adam Thomson , Li Jun , Badhri Jagan Sridharan , Hans de Goede , Min Guo , , , , , Date: Fri, 15 Mar 2019 17:14:08 +0800 In-Reply-To: <20190315091127.GF7752@kuha.fi.intel.com> References: <1552635513-2378-1-git-send-email-chunfeng.yun@mediatek.com> <1552635513-2378-5-git-send-email-chunfeng.yun@mediatek.com> <20190315081835.GD7752@kuha.fi.intel.com> <20190315091127.GF7752@kuha.fi.intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Fri, 2019-03-15 at 11:11 +0200, Heikki Krogerus wrote: > On Fri, Mar 15, 2019 at 10:18:35AM +0200, Heikki Krogerus wrote: > > Andy already pointed out that you need to use fwnodes. > > > > Rule of thumb: You always use fwnodes. Only if there is something that > > can't be done with fwnodes you use DT or ACPI nodes directly. > > > > In this case there is absolutely nothing that would prevent you from > > using fwnodes. > > ... > > > +/** > > + * usb_role_switch_get_by_node - Find USB role switch by it's parent node > > + * @node: The node that register USB role switch > > + * > > + * Finds and returns role switch registered by @node. The reference count > > + * for the found switch is incremented. > > + */ > > +struct usb_role_switch *usb_role_switch_get_by_node(struct device_node *node) > > This is my proposal for function prototype: > > struct usb_role_switch * > fwnode_usb_role_switch_get(struct fwnode_handle *fwnode); Ok, thanks again > > > thanks, >