usb: host: xhci-plat: move clk to plat own private structure
Subsystems (2)
PATCH 1/1 usb: host: xhci-plat: move clk to plat own private structure
commit 4efb2f694114 ("usb: host: xhci-plat: add struct xhci_plat_priv") introduced struct xhci_plat_priv to hold the plat driver's specific variables. The clk is only for plat driver, so let's move it to the proper structure.
Signed-off-by Jisheng Zhang <[email protected]>
--- drivers/usb/host/xhci-plat.c | 17 +++++++++++------ drivers/usb/host/xhci-plat.h | 2 ++ drivers/usb/host/xhci.h | 2 -- 3 files changed, 13 insertions(+), 8 deletions(-)
drivers/usb/host/xhci-plat.c +11 -6
@@ -152,6 +152,7 @@ static int xhci_plat_probe(struct platform_device *pdev) {const struct xhci_plat_priv *priv_match;const struct hc_driver *driver; +struct xhci_plat_priv *priv;struct device *sysdev;struct xhci_hcd *xhci;struct resource *res;
@@ -240,6 +241,7 @@ static int xhci_plat_probe(struct platform_device *pdev) } xhci =hcd_to_xhci (hcd); + priv =hcd_to_xhci_priv (hcd); priv_match =of_device_get_match_data (&pdev->dev);if (priv_match) {struct xhci_plat_priv *priv =hcd_to_xhci_priv (hcd);
@@ -251,7 +253,7 @@ static int xhci_plat_probe(struct platform_device *pdev)device_wakeup_enable (hcd->self.controller); - xhci->clk = clk; + priv->clk = clk; xhci->main_hcd = hcd; xhci->shared_hcd =__usb_create_hcd (driver, sysdev, &pdev->dev,dev_name (&pdev->dev), hcd);
@@ -331,7 +333,8 @@ static int xhci_plat_remove(struct platform_device *dev) {struct usb_hcd *hcd =platform_get_drvdata (dev);struct xhci_hcd *xhci =hcd_to_xhci (hcd); -struct clk *clk = xhci->clk; +struct xhci_plat_priv *priv =hcd_to_xhci_priv (hcd); +struct clk *clk = priv->clk; xhci->xhc_state |=XHCI_STATE_REMOVING ;
@@ -355,6 +358,7 @@ static int __maybe_unused xhci_plat_suspend(struct device *dev) {struct usb_hcd *hcd =dev_get_drvdata (dev);struct xhci_hcd *xhci =hcd_to_xhci (hcd); +struct xhci_plat_priv *priv =hcd_to_xhci_priv (hcd);int ret;/*
@@ -367,8 +371,8 @@ static int __maybe_unused xhci_plat_suspend(struct device *dev)*/ ret =xhci_suspend (xhci,device_may_wakeup (dev)); -if (!device_may_wakeup (dev) && !IS_ERR (xhci->clk)) -clk_disable_unprepare (xhci->clk); +if (!device_may_wakeup (dev) && !IS_ERR (priv->clk)) +clk_disable_unprepare (priv->clk);return ret; }
@@ -377,10 +381,11 @@ static int __maybe_unused xhci_plat_resume(struct device *dev) {struct usb_hcd *hcd =dev_get_drvdata (dev);struct xhci_hcd *xhci =hcd_to_xhci (hcd); +struct xhci_plat_priv *priv =hcd_to_xhci_priv (hcd);int ret; -if (!device_may_wakeup (dev) && !IS_ERR (xhci->clk)) -clk_prepare_enable (xhci->clk); +if (!device_may_wakeup (dev) && !IS_ERR (priv->clk)) +clk_prepare_enable (priv->clk); ret =xhci_priv_resume_quirk (hcd);if (ret)
drivers/usb/host/xhci-plat.h +2 -0
@@ -12,6 +12,8 @@struct xhci_plat_priv {const char *firmware_name; +/* optional clock */ +struct clk *clk;void (*plat_start)(struct usb_hcd *);int (*init_quirk)(struct usb_hcd *);int (*resume_quirk)(struct usb_hcd *);
drivers/usb/host/xhci.h +0 -2
@@ -1724,8 +1724,6 @@ struct xhci_hcd {int page_shift;/* msi-x vectors */ int msix_count; -/* optional clock */ -struct clk *clk;/* data structures */ struct xhci_device_context_array *dcbaa;struct xhci_ring *cmd_ring;
Signature · 1 line
1.9.1