From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heikki Krogerus Subject: Re: [PATCH v2 4/6] usb: roles: add API to get usb_role_switch by node Date: Fri, 15 Mar 2019 11:11:27 +0200 Message-ID: <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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20190315081835.GD7752@kuha.fi.intel.com> Sender: linux-kernel-owner@vger.kernel.org To: Chunfeng Yun , Andy Shevchenko Cc: 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: devicetree@vger.kernel.org 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); thanks, -- heikki