Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751479AbdFFHLe (ORCPT ); Tue, 6 Jun 2017 03:11:34 -0400 Received: from mail-pf0-f169.google.com ([209.85.192.169]:33640 "EHLO mail-pf0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751347AbdFFHLc (ORCPT ); Tue, 6 Jun 2017 03:11:32 -0400 From: "Thang Q. Nguyen" To: Mathias Nyman , Greg Kroah-Hartman , Sriram Dash , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Thang Nguyen , Phong Vo , Loc Ho , Tung Nguyen , patches@apm.com Subject: [PATCH v1 1/1] usb:xhci: update condition to select bus->sysdev from parent device Date: Tue, 6 Jun 2017 14:11:19 +0700 Message-Id: <1496733079-9410-1-git-send-email-tqnguyen@apm.com> X-Mailer: git-send-email 1.7.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1217 Lines: 30 For commit 4c39d4b949d3 ("usb: xhci: use bus->sysdev for DMA configuration"), sysdev points to devices known to the system firmware or hardware for DMA parameters. However, the parent of the system firmware/hardware device checking logic does not work in ACPI boot mode. This patch updates the formulation to check this case in both DT and ACPI. Signed-off-by: Tung Nguyen Signed-off-by: Thang Q. Nguyen --- drivers/usb/host/xhci-plat.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index c04144b..e3e342a 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -187,7 +187,9 @@ static int xhci_plat_probe(struct platform_device *pdev) * 3. xhci_plat is grandchild of a pci device (dwc3-pci) */ sysdev = &pdev->dev; - if (sysdev->parent && !sysdev->of_node && sysdev->parent->of_node) + if (sysdev->parent && (sysdev->fwnode->type == FWNODE_PDATA) && + (is_of_node(sysdev->parent->fwnode) || + is_acpi_device_node(sysdev->parent->fwnode))) sysdev = sysdev->parent; #ifdef CONFIG_PCI else if (sysdev->parent && sysdev->parent->parent && -- 1.7.1