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