From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754321AbcHWPic (ORCPT ); Tue, 23 Aug 2016 11:38:32 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:59842 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753623AbcHWPhY (ORCPT ); Tue, 23 Aug 2016 11:37:24 -0400 Date: Tue, 23 Aug 2016 11:37:20 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Peter Chen cc: Peter Chen , , , , , , , , , , , , , , , USB list , , , , , , , , Linux-pm mailing list , , Kernel development list , Subject: Re: [PATCH v6 4/8] usb: core: add power sequence handling for USB devices In-Reply-To: <20160823031021.GB13986@shlinux2> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 23 Aug 2016, Peter Chen wrote: > I will add #ifdef CONFIG_OF for related code. And put the content at > hub_pwrseq_on at hub_probe directly, how about below? > > hub_probe() { > > ... > > if (hub_configure(hub, endpoint) >= 0) { > #ifdef CONFIG_OF > for_each_child_of_node(parent->of_node, np) { > ret = generic_pwrseq_on(np, hub); > if (ret) > return ret; > } > #else > return 0; > #endif > } Please make this a separate subroutine like you had before, but now in hub.c: #ifdef CONFIG_OF static int hub_of_pwrseq_on(struct usb_hub *hub) { ... } #else static inline int hub_of_pwrseq_on(struct usb_hub *hub) { return 0; } #endif /* CONFIG_OF */ Alan Stern From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Stern Subject: Re: [PATCH v6 4/8] usb: core: add power sequence handling for USB devices Date: Tue, 23 Aug 2016 11:37:20 -0400 (EDT) Message-ID: References: <20160823031021.GB13986@shlinux2> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20160823031021.GB13986@shlinux2> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Peter Chen Cc: mark.rutland@arm.com, Peter Chen , ulf.hansson@linaro.org, stephen.boyd@linaro.org, k.kozlowski@samsung.com, Kernel development list , festevam@gmail.com, stillcompiling@gmail.com, pawel.moll@arm.com, dbaryshkov@gmail.com, mka@chromium.org, dwmw3@infradead.org, devicetree@vger.kernel.org, mail@maciej.szmigiero.name, arnd@arndb.de, Linux-pm mailing list , s.hauer@pengutronix.de, troy.kisky@boundarydevices.com, robh+dt@kernel.org, linux-arm-kernel@lists.infradead.org, oscar@naiandei.net, gregkh@linuxfoundation.org, USB list , sre@kernel.org, broonie@kernel.org, p.zabel@pengutronix.de, shawnguo@kernel.org List-Id: devicetree@vger.kernel.org On Tue, 23 Aug 2016, Peter Chen wrote: > I will add #ifdef CONFIG_OF for related code. And put the content at > hub_pwrseq_on at hub_probe directly, how about below? > > hub_probe() { > > ... > > if (hub_configure(hub, endpoint) >= 0) { > #ifdef CONFIG_OF > for_each_child_of_node(parent->of_node, np) { > ret = generic_pwrseq_on(np, hub); > if (ret) > return ret; > } > #else > return 0; > #endif > } Please make this a separate subroutine like you had before, but now in hub.c: #ifdef CONFIG_OF static int hub_of_pwrseq_on(struct usb_hub *hub) { ... } #else static inline int hub_of_pwrseq_on(struct usb_hub *hub) { return 0; } #endif /* CONFIG_OF */ Alan Stern From mboxrd@z Thu Jan 1 00:00:00 1970 From: stern@rowland.harvard.edu (Alan Stern) Date: Tue, 23 Aug 2016 11:37:20 -0400 (EDT) Subject: [PATCH v6 4/8] usb: core: add power sequence handling for USB devices In-Reply-To: <20160823031021.GB13986@shlinux2> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Tue, 23 Aug 2016, Peter Chen wrote: > I will add #ifdef CONFIG_OF for related code. And put the content at > hub_pwrseq_on at hub_probe directly, how about below? > > hub_probe() { > > ... > > if (hub_configure(hub, endpoint) >= 0) { > #ifdef CONFIG_OF > for_each_child_of_node(parent->of_node, np) { > ret = generic_pwrseq_on(np, hub); > if (ret) > return ret; > } > #else > return 0; > #endif > } Please make this a separate subroutine like you had before, but now in hub.c: #ifdef CONFIG_OF static int hub_of_pwrseq_on(struct usb_hub *hub) { ... } #else static inline int hub_of_pwrseq_on(struct usb_hub *hub) { return 0; } #endif /* CONFIG_OF */ Alan Stern