Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1593934

[PATCH 1/2] usb: xhci-mtk: rebuild xhci_mtk_setup()

From Chunfeng Yun <chunfeng.yun@mediatek.com>
Newsgroups linux.kernel
Subject [PATCH 1/2] usb: xhci-mtk: rebuild xhci_mtk_setup()
Date 2017-03-07 08:30 +0100
Message-ID <tihJg-45F-7@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


simplify xhci_mtk_setup() and add xhci_mtk_start() for
xhci_driver_overrides struct

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
 drivers/usb/host/xhci-mtk.c |   16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
index 67d5dc7..9636884 100644
--- a/drivers/usb/host/xhci-mtk.c
+++ b/drivers/usb/host/xhci-mtk.c
@@ -381,8 +381,10 @@ static int usb_wakeup_of_property_parse(struct xhci_hcd_mtk *mtk,
 }
 
 static int xhci_mtk_setup(struct usb_hcd *hcd);
+static int xhci_mtk_start(struct usb_hcd *hcd);
 static const struct xhci_driver_overrides xhci_mtk_overrides __initconst = {
 	.reset = xhci_mtk_setup,
+	.start = xhci_mtk_start,
 };
 
 static struct hc_driver __read_mostly xhci_mtk_hc_driver;
@@ -492,7 +494,6 @@ static void xhci_mtk_quirks(struct device *dev, struct xhci_hcd *xhci)
 /* called during probe() after chip reset completes */
 static int xhci_mtk_setup(struct usb_hcd *hcd)
 {
-	struct xhci_hcd *xhci = hcd_to_xhci(hcd);
 	struct xhci_hcd_mtk *mtk = hcd_to_mtk(hcd);
 	int ret;
 
@@ -502,9 +503,14 @@ static int xhci_mtk_setup(struct usb_hcd *hcd)
 			return ret;
 	}
 
-	ret = xhci_gen_setup(hcd, xhci_mtk_quirks);
-	if (ret)
-		return ret;
+	return xhci_gen_setup(hcd, xhci_mtk_quirks);
+}
+
+static int xhci_mtk_start(struct usb_hcd *hcd)
+{
+	struct xhci_hcd *xhci = hcd_to_xhci(hcd);
+	struct xhci_hcd_mtk *mtk = hcd_to_mtk(hcd);
+	int ret;
 
 	if (usb_hcd_is_primary_hcd(hcd)) {
 		mtk->num_u3_ports = xhci->num_usb3_ports;
@@ -514,7 +520,7 @@ static int xhci_mtk_setup(struct usb_hcd *hcd)
 			return ret;
 	}
 
-	return ret;
+	return xhci_run(hcd);
 }
 
 static int xhci_mtk_probe(struct platform_device *pdev)
-- 
1.7.9.5

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] usb: xhci-mtk: rebuild xhci_mtk_setup() Chunfeng Yun <chunfeng.yun@mediatek.com> - 2017-03-07 08:30 +0100
  [PATCH 2/2] usb: xhci-mtk: fix checkpatch warning and erorr Chunfeng Yun <chunfeng.yun@mediatek.com> - 2017-03-07 08:30 +0100
  Re: [PATCH 1/2] usb: xhci-mtk: rebuild xhci_mtk_setup() Mathias Nyman <mathias.nyman@linux.intel.com> - 2017-03-07 16:00 +0100
    Re: [PATCH 1/2] usb: xhci-mtk: rebuild xhci_mtk_setup() Chunfeng Yun <chunfeng.yun@mediatek.com> - 2017-03-08 03:20 +0100

csiph-web