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=-2.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED, USER_AGENT_MUTT 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 9D99FC43381 for ; Fri, 15 Mar 2019 09:11: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 6F1062184C for ; Fri, 15 Mar 2019 09:11:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="j2oAMCj5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6F1062184C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.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:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PHZPWYDDA5xHt3HM4jYPpqJVPEoJJQaY/C+h1kD8rIs=; b=j2oAMCj5gMzKgO jmxeCm4xGEdGy4xDvplnSZOpHaWNTJ13mzYufba0Y8mrJa4vwqVDkQfc8sT1uIIQnpjaITN4WUD/n vO/RqjikvN/wIFLRpWni++8Bq2ZgHuAKI9oZ1GXANjAWi4a22hrQAhTlJHQTpP4vWcfKeqaktGtNd on7WH3imjoJLF4AO7sXjtgaB97oaZ5wIXOPjGPXiZGXb8ybD/oe2DLMMYTq/XhpDohdDrKxMfWN8u rI+BeCewcphmrBynY/S9RPKmR5cTT+6JSZURfdJToOJVmAbQa3UQpVDUkTOVb2OoeH6Z42Z78yLNi 8FYWjleHZRxBVOdE3OYQ==; 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 1h4isJ-0003Y5-Uz; Fri, 15 Mar 2019 09:11:35 +0000 Received: from mga04.intel.com ([192.55.52.120]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h4isG-0003Xa-Jj; Fri, 15 Mar 2019 09:11:33 +0000 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Mar 2019 02:11:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,481,1544515200"; d="scan'208";a="155287992" Received: from kuha.fi.intel.com ([10.237.72.189]) by fmsmga001.fm.intel.com with SMTP; 15 Mar 2019 02:11:27 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Fri, 15 Mar 2019 11:11:27 +0200 Date: Fri, 15 Mar 2019 11:11:27 +0200 From: Heikki Krogerus To: Chunfeng Yun , Andy Shevchenko Subject: Re: [PATCH v2 4/6] usb: roles: add API to get usb_role_switch by node 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-Disposition: inline In-Reply-To: <20190315081835.GD7752@kuha.fi.intel.com> User-Agent: Mutt/1.11.3 (2019-02-01) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190315_021132_666700_030CB9AF X-CRM114-Status: GOOD ( 12.17 ) 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 , 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 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel