Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp506919img; Mon, 18 Mar 2019 08:01:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqz2rH7+4xxsEp+1LN/D9QOoPcpQCMOUt9MvrJ5m7P4ovdX6Mk9aWFfBAfPRpLJvsMrRBw/Q X-Received: by 2002:a63:f74c:: with SMTP id f12mr2805687pgk.124.1552921272507; Mon, 18 Mar 2019 08:01:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552921272; cv=none; d=google.com; s=arc-20160816; b=Kr8ldEUcWPjJzAWkUre6iV0YbUGjbQIj1sE+h6mDYOuq2zSi/n2tGcmZFWXhWd1d8/ 8yMqjBwbqBQ1Aveu4sAgLf7EpHiFQ/BiecoI2GEZMpsgTXWgDt6P91GbFJq9B/Gj2/Ud 9mXFs9Dgp1HxXbkAZQRXIgcu+nX5o9VhIC0I5oDtNW1hpz0mh/ELA3HdTDIDCCKNRBS6 qvMpTJjEI0FZB1EpEOylRzy/OF9scekrKvc5IwS70bHIRY+j0QMscsQbsKUuCLqv8nNw lq7NDxfbGeXWX9mSc8fIoPZssaHR2qPWTi66hmkcp1AiNvgJbW7cv8cICRDsWii+aG7T jQ/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:in-reply-to:subject:cc:to:from:date; bh=bYIZsYrk346FWdBXr19koV5D6ECVLnaWmVfR4Qn75MI=; b=mQ5moqgJpPysE0z3PKYLg0LnF1NGLNmMqiJVtirHYmobnjVjLGpii7c2BpwU1kntgs fC1839VZKUpo2j8kmNKXRpS2l06bzV6RJ+Ap4rBXKmulwj2WO9wotDMNkzt0Mc2LdF9T PmJiPn5vtR4MZEIybZm6rIRqjYFqJSv08KB31RpWa4QeOzOYg8lbWD5P7aLy3/Ayv/CE yo+H/2OF/uvMf6kSjk3UXKNkWBJRa2NcGUla4hRk8YJp94adQRkQLq+OEjSV30c2nbxG SCD/AXBLdR3YHwwh3TpJNWHMo6Gq4y7z4rarmAt3fRVHgJGp7s2VOujWEt8ZP9z9NWbn CdsQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bg5si9428724plb.235.2019.03.18.08.00.56; Mon, 18 Mar 2019 08:01:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727830AbfCRO63 (ORCPT + 99 others); Mon, 18 Mar 2019 10:58:29 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:54122 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726731AbfCRO63 (ORCPT ); Mon, 18 Mar 2019 10:58:29 -0400 Received: (qmail 4435 invoked by uid 2102); 18 Mar 2019 10:58:28 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 18 Mar 2019 10:58:28 -0400 Date: Mon, 18 Mar 2019 10:58:28 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= cc: Greg Kroah-Hartman , Rob Herring , Mark Rutland , , , Subject: Re: [PATCH 2/2] usb: hub: use non-removable-ports DT property In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 18 Mar 2019, [iso-8859-1] M?ns Rullg?rd wrote: > Mans Rullgard writes: > > > Mark any ports listed in the non-removable-ports DT property as > > hardwired. This is useful for boards with built-in USB devices > > that cannot be (or have not been) marked as fixed in hardware. > > > > Signed-off-by: Mans Rullgard > > --- > > drivers/usb/core/hub.c | 14 ++++++++++++++ > > 1 file changed, 14 insertions(+) > > Any comments on these patches? > > > diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c > > index 3adff4da2ee1..44ac49a30be1 100644 > > --- a/drivers/usb/core/hub.c > > +++ b/drivers/usb/core/hub.c > > @@ -1328,6 +1328,9 @@ static int hub_configure(struct usb_hub *hub, > > unsigned unit_load; > > unsigned full_load; > > unsigned maxchild; > > + struct property *prop; > > + const __be32 *cur; > > + u32 val; > > > > hub->buffer = kmalloc(sizeof(*hub->buffer), GFP_KERNEL); > > if (!hub->buffer) { > > @@ -1629,6 +1632,17 @@ static int hub_configure(struct usb_hub *hub, > > } > > } > > > > + of_property_for_each_u32(hub_dev->of_node, "non-removable-ports", > > + prop, cur, val) { > > + if (val < 1 || val > hdev->maxchild) { > > + dev_warn(hub_dev, "port number %u out of range\n", val); > > + continue; > > + } > > + > > + hub->ports[val - 1]->connect_type = > > + USB_PORT_CONNECT_TYPE_HARD_WIRED; > > + } > > + > > usb_hub_adjust_deviceremovable(hdev, hub->descriptor); > > > > hub_activate(hub, HUB_INIT); > > -- > > 2.20.1 This seems like a reasonable thing to do. However, you should improve the warning message; people who encounter it will have no idea what it refers to. Alan Stern