Commit 54969ed6 authored by Vivek Gautam's avatar Vivek Gautam Committed by Greg Kroah-Hartman

usb: ohci-exynos: Use struct device instead of platform_device

Change to use struct device instead of struct platform_device
for some static functions.
Signed-off-by: default avatarVivek Gautam <gautam.vivek@samsung.com>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Acked-by: default avatarJingoo Han <jg1.han@samsung.com>
Acked-by: default avatarKukjin Kim <kgene.kim@samsung.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent efccd24a
...@@ -39,18 +39,18 @@ struct exynos_ohci_hcd { ...@@ -39,18 +39,18 @@ struct exynos_ohci_hcd {
struct usb_otg *otg; struct usb_otg *otg;
}; };
static void exynos_ohci_phy_enable(struct platform_device *pdev) static void exynos_ohci_phy_enable(struct device *dev)
{ {
struct usb_hcd *hcd = platform_get_drvdata(pdev); struct usb_hcd *hcd = dev_get_drvdata(dev);
struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd);
if (exynos_ohci->phy) if (exynos_ohci->phy)
usb_phy_init(exynos_ohci->phy); usb_phy_init(exynos_ohci->phy);
} }
static void exynos_ohci_phy_disable(struct platform_device *pdev) static void exynos_ohci_phy_disable(struct device *dev)
{ {
struct usb_hcd *hcd = platform_get_drvdata(pdev); struct usb_hcd *hcd = dev_get_drvdata(dev);
struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd);
if (exynos_ohci->phy) if (exynos_ohci->phy)
...@@ -139,7 +139,7 @@ static int exynos_ohci_probe(struct platform_device *pdev) ...@@ -139,7 +139,7 @@ static int exynos_ohci_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, hcd); platform_set_drvdata(pdev, hcd);
exynos_ohci_phy_enable(pdev); exynos_ohci_phy_enable(&pdev->dev);
err = usb_add_hcd(hcd, irq, IRQF_SHARED); err = usb_add_hcd(hcd, irq, IRQF_SHARED);
if (err) { if (err) {
...@@ -150,7 +150,7 @@ static int exynos_ohci_probe(struct platform_device *pdev) ...@@ -150,7 +150,7 @@ static int exynos_ohci_probe(struct platform_device *pdev)
return 0; return 0;
fail_add_hcd: fail_add_hcd:
exynos_ohci_phy_disable(pdev); exynos_ohci_phy_disable(&pdev->dev);
fail_io: fail_io:
clk_disable_unprepare(exynos_ohci->clk); clk_disable_unprepare(exynos_ohci->clk);
fail_clk: fail_clk:
...@@ -168,7 +168,7 @@ static int exynos_ohci_remove(struct platform_device *pdev) ...@@ -168,7 +168,7 @@ static int exynos_ohci_remove(struct platform_device *pdev)
if (exynos_ohci->otg) if (exynos_ohci->otg)
exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self); exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self);
exynos_ohci_phy_disable(pdev); exynos_ohci_phy_disable(&pdev->dev);
clk_disable_unprepare(exynos_ohci->clk); clk_disable_unprepare(exynos_ohci->clk);
...@@ -190,7 +190,6 @@ static int exynos_ohci_suspend(struct device *dev) ...@@ -190,7 +190,6 @@ static int exynos_ohci_suspend(struct device *dev)
{ {
struct usb_hcd *hcd = dev_get_drvdata(dev); struct usb_hcd *hcd = dev_get_drvdata(dev);
struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd);
struct platform_device *pdev = to_platform_device(dev);
bool do_wakeup = device_may_wakeup(dev); bool do_wakeup = device_may_wakeup(dev);
int rc = ohci_suspend(hcd, do_wakeup); int rc = ohci_suspend(hcd, do_wakeup);
...@@ -200,7 +199,7 @@ static int exynos_ohci_suspend(struct device *dev) ...@@ -200,7 +199,7 @@ static int exynos_ohci_suspend(struct device *dev)
if (exynos_ohci->otg) if (exynos_ohci->otg)
exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self); exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self);
exynos_ohci_phy_disable(pdev); exynos_ohci_phy_disable(dev);
clk_disable_unprepare(exynos_ohci->clk); clk_disable_unprepare(exynos_ohci->clk);
...@@ -211,14 +210,13 @@ static int exynos_ohci_resume(struct device *dev) ...@@ -211,14 +210,13 @@ static int exynos_ohci_resume(struct device *dev)
{ {
struct usb_hcd *hcd = dev_get_drvdata(dev); struct usb_hcd *hcd = dev_get_drvdata(dev);
struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd); struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd);
struct platform_device *pdev = to_platform_device(dev);
clk_prepare_enable(exynos_ohci->clk); clk_prepare_enable(exynos_ohci->clk);
if (exynos_ohci->otg) if (exynos_ohci->otg)
exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self); exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self);
exynos_ohci_phy_enable(pdev); exynos_ohci_phy_enable(dev);
ohci_resume(hcd, false); ohci_resume(hcd, false);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment