Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1933261pxb; Wed, 10 Feb 2021 23:01:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJxGknE+KMiJDOJ97/7PlN4U7RPd3iiI1eE3xrxx/mgoet8JvzUZu5bVLLLoeGXcT74Rdv9h X-Received: by 2002:a17:906:1355:: with SMTP id x21mr6953324ejb.53.1613026915007; Wed, 10 Feb 2021 23:01:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613026914; cv=none; d=google.com; s=arc-20160816; b=OpCJlJ2EswnC4rW2/g8FWTulVpv8LQIHb1Hg4xx5tZ0t6+s/C6qpLpEk9IVBvIfGpp m7HEis8cnizf+TVoHdQBcFIMq9RJvJek2purodLLF8mdGrKdGDszR3GC9hp0hq7Ypq4Q FlQOlmlACooAZO+F75EjyGNOkjjsIv54Jb1N9jMhQ3qVs+pBCoGG1IkXd9cVm8529AWM gep+DHlWXP3AcSFeQA+Blwp7Jfs7pXEe3EijsmoLoXPPdYVZVaCtC33DialidZGpQ5M+ kLVyJz7qW0ZKiHGqZNZsQuiKUj2s+a/uWAAoqa9lRrx8iNHM1GmSEEr9ifHG/wnp7IBr vLXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ixlk8RfpKTF76ZGjMdVvJ1NSm/2l6q92KTp7D1gw3QA=; b=YxumLQv4Gm1drLawkYeNXezqlZJHLCa98btSluo8e2m70qyiGcidzeN7wmHKplu4vX w3D+yRN5q/0sSvg7D54dvHZnNr3faJicFIdMyucR+aTCTo+H71zshjS0hQHq2ApsjnuE p/VRJGArpKrWyecGj1E/V4uK91HQIXNcW1oMsV/4FfM3IYVtc6qvB+DBe0YRBITixs+j UofDKiL1r4t/f1n5K2+8XfBx31y3W4edhpzbX+Ats1bgmOXnrooZLrqz9IqK8rQStSGs Yxtud0Xlucp1qodxepLkOrsB8blAY53inESwEV27Ib7IbCt+S0Yy5Y2tYpJbboiFSa0k yCpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=V++EvLxj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a42si4087116edf.469.2021.02.10.23.01.31; Wed, 10 Feb 2021 23:01:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=V++EvLxj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229665AbhBKG7K (ORCPT + 99 others); Thu, 11 Feb 2021 01:59:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:53926 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229501AbhBKG7H (ORCPT ); Thu, 11 Feb 2021 01:59:07 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id ACB9864DBD; Thu, 11 Feb 2021 06:58:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1613026706; bh=T6VVnDDvYITb11F5FAe5DP7RfwvRM0uYGlboSDsTbfY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=V++EvLxj2ltRjen3B4FrdawdfznB9NaHwJsxkkoHxonfh8Dywq1mD8Yl7ZHYgZDoA pE6YCvTD28KzVMXw4j1/vbObjxmSZYRZTozgz66b/Eyb/w5ekF2zsmBD5WTl5XX5h0 8dE1vCbXHzwnwmaY4r7oCV1IieMwLwbhIKh3oNMA= Date: Thu, 11 Feb 2021 07:58:23 +0100 From: Greg Kroah-Hartman To: Matthias Kaehlcke Cc: Rob Herring , Frank Rowand , devicetree@vger.kernel.org, Peter Chen , Stephen Boyd , Alan Stern , Ravi Chandra Sadineni , Bastien Nocera , linux-kernel@vger.kernel.org, Douglas Anderson , linux-usb@vger.kernel.org, Krzysztof Kozlowski , Mathias Nyman Subject: Re: [PATCH v5 3/4] usb: host: xhci-plat: Create platform device for onboard hubs in probe() Message-ID: References: <20210210171040.684659-1-mka@chromium.org> <20210210091015.v5.3.I7a3a7d9d2126c34079b1cab87aa0b2ec3030f9b7@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210210091015.v5.3.I7a3a7d9d2126c34079b1cab87aa0b2ec3030f9b7@changeid> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 10, 2021 at 09:10:38AM -0800, Matthias Kaehlcke wrote: > Check during probe() if a hub supported by the onboard_usb_hub > driver is connected to the controller. If such a hub is found > create the corresponding platform device. This requires the > device tree to have a node for the hub with its vendor and > product id (which is not common for USB devices). Further the > platform device is only created when CONFIG_USB_ONBOARD_HUB=y/m. > > Signed-off-by: Matthias Kaehlcke > --- > > Changes in v5: > - patch added to the series > > drivers/usb/host/xhci-plat.c | 16 ++++++++++++++++ > include/linux/usb/hcd.h | 2 ++ > 2 files changed, 18 insertions(+) > > diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c > index 4d34f6005381..e785fa109eea 100644 > --- a/drivers/usb/host/xhci-plat.c > +++ b/drivers/usb/host/xhci-plat.c > @@ -15,6 +15,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -184,6 +185,7 @@ static int xhci_plat_probe(struct platform_device *pdev) > int ret; > int irq; > struct xhci_plat_priv *priv = NULL; > + struct device_node *np; > > > if (usb_disabled()) > @@ -356,6 +358,17 @@ static int xhci_plat_probe(struct platform_device *pdev) > */ > pm_runtime_forbid(&pdev->dev); > > + np = usb_of_get_device_node(hcd->self.root_hub, hcd->self.busnum); > + if (np && of_is_onboard_usb_hub(np)) { > + struct platform_device *pdev; > + > + pdev = of_platform_device_create(np, NULL, NULL); A platform device is a child of another platform device? Ok, but really, why? What uses this device? thanks, greg k-h