From patchwork Mon May 21 13:40:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathias Nyman X-Patchwork-Id: 10415343 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D04546032C for ; Mon, 21 May 2018 13:38:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C285B27968 for ; Mon, 21 May 2018 13:38:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B721627D0C; Mon, 21 May 2018 13:38:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D3D727968 for ; Mon, 21 May 2018 13:38:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752648AbeEUNiJ (ORCPT ); Mon, 21 May 2018 09:38:09 -0400 Received: from mga05.intel.com ([192.55.52.43]:64081 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752101AbeEUNiF (ORCPT ); Mon, 21 May 2018 09:38:05 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 May 2018 06:38:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,426,1520924400"; d="scan'208";a="40976894" Received: from mattu-haswell.fi.intel.com ([10.237.72.164]) by fmsmga007.fm.intel.com with ESMTP; 21 May 2018 06:38:03 -0700 From: Mathias Nyman To: Cc: , Mathias Nyman Subject: [PATCH 15/18] xhci-mtk: use xhci hub structures to get number of ports in roothubs Date: Mon, 21 May 2018 16:40:03 +0300 Message-Id: <1526910006-26104-16-git-send-email-mathias.nyman@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526910006-26104-1-git-send-email-mathias.nyman@linux.intel.com> References: <1526910006-26104-1-git-send-email-mathias.nyman@linux.intel.com> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-mtk-sch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci-mtk-sch.c b/drivers/usb/host/xhci-mtk-sch.c index eea7360..fa33d6e 100644 --- a/drivers/usb/host/xhci-mtk-sch.c +++ b/drivers/usb/host/xhci-mtk-sch.c @@ -58,7 +58,7 @@ static int get_bw_index(struct xhci_hcd *xhci, struct usb_device *udev, bw_index = (virt_dev->real_port - 1) * 2 + 1; } else { /* add one more for each SS port */ - bw_index = virt_dev->real_port + xhci->num_usb3_ports - 1; + bw_index = virt_dev->real_port + xhci->usb3_rhub.num_ports - 1; } return bw_index; @@ -284,7 +284,7 @@ int xhci_mtk_sch_init(struct xhci_hcd_mtk *mtk) int i; /* ss IN and OUT are separated */ - num_usb_bus = xhci->num_usb3_ports * 2 + xhci->num_usb2_ports; + num_usb_bus = xhci->usb3_rhub.num_ports * 2 + xhci->usb2_rhub.num_ports; sch_array = kcalloc(num_usb_bus, sizeof(*sch_array), GFP_KERNEL); if (sch_array == NULL)