]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
USB: host: use to_platform_device
authorGeliang Tang <geliangtang@163.com>
Wed, 23 Dec 2015 13:26:52 +0000 (21:26 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Jan 2016 05:00:33 +0000 (21:00 -0800)
Use to_platform_device() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ehci-platform.c
drivers/usb/host/ehci-st.c
drivers/usb/host/ohci-platform.c
drivers/usb/host/ohci-st.c

index bd7082f297bbe76b7db8c10ad091402c79f45786..1757ebb471b6d992d87d549fc6c61a7f375fcb71 100644 (file)
@@ -345,8 +345,7 @@ static int ehci_platform_suspend(struct device *dev)
 {
        struct usb_hcd *hcd = dev_get_drvdata(dev);
        struct usb_ehci_pdata *pdata = dev_get_platdata(dev);
-       struct platform_device *pdev =
-               container_of(dev, struct platform_device, dev);
+       struct platform_device *pdev = to_platform_device(dev);
        bool do_wakeup = device_may_wakeup(dev);
        int ret;
 
@@ -364,8 +363,7 @@ static int ehci_platform_resume(struct device *dev)
 {
        struct usb_hcd *hcd = dev_get_drvdata(dev);
        struct usb_ehci_pdata *pdata = dev_get_platdata(dev);
-       struct platform_device *pdev =
-               container_of(dev, struct platform_device, dev);
+       struct platform_device *pdev = to_platform_device(dev);
        struct ehci_platform_priv *priv = hcd_to_ehci_priv(hcd);
 
        if (pdata->power_on) {
index b7c5cfa37a83501f8430837cab16fdf19b370c13..a94ed677d93747c143d01879a175bad23f8f795f 100644 (file)
@@ -287,8 +287,7 @@ static int st_ehci_suspend(struct device *dev)
 {
        struct usb_hcd *hcd = dev_get_drvdata(dev);
        struct usb_ehci_pdata *pdata = dev_get_platdata(dev);
-       struct platform_device *pdev =
-               container_of(dev, struct platform_device, dev);
+       struct platform_device *pdev = to_platform_device(dev);
        bool do_wakeup = device_may_wakeup(dev);
        int ret;
 
@@ -308,8 +307,7 @@ static int st_ehci_resume(struct device *dev)
 {
        struct usb_hcd *hcd = dev_get_drvdata(dev);
        struct usb_ehci_pdata *pdata = dev_get_platdata(dev);
-       struct platform_device *pdev =
-               container_of(dev, struct platform_device, dev);
+       struct platform_device *pdev = to_platform_device(dev);
        int err;
 
        pinctrl_pm_select_default_state(dev);
index c2669f185f658c76f74e9f5c8ec651cbb92ec397..ae1c988da146e556f4b7fe386ad26264d0b20d90 100644 (file)
@@ -310,8 +310,7 @@ static int ohci_platform_suspend(struct device *dev)
 {
        struct usb_hcd *hcd = dev_get_drvdata(dev);
        struct usb_ohci_pdata *pdata = dev->platform_data;
-       struct platform_device *pdev =
-               container_of(dev, struct platform_device, dev);
+       struct platform_device *pdev = to_platform_device(dev);
        bool do_wakeup = device_may_wakeup(dev);
        int ret;
 
@@ -329,8 +328,7 @@ static int ohci_platform_resume(struct device *dev)
 {
        struct usb_hcd *hcd = dev_get_drvdata(dev);
        struct usb_ohci_pdata *pdata = dev_get_platdata(dev);
-       struct platform_device *pdev =
-               container_of(dev, struct platform_device, dev);
+       struct platform_device *pdev = to_platform_device(dev);
 
        if (pdata->power_on) {
                int err = pdata->power_on(pdev);
index df9028e0d9b4776a0e5c77e7c61911e1bae567c0..acf2eb2a56766358c2bbdef931b070c2c81ad43d 100644 (file)
@@ -270,8 +270,7 @@ static int st_ohci_suspend(struct device *dev)
 {
        struct usb_hcd *hcd = dev_get_drvdata(dev);
        struct usb_ohci_pdata *pdata = dev->platform_data;
-       struct platform_device *pdev =
-               container_of(dev, struct platform_device, dev);
+       struct platform_device *pdev = to_platform_device(dev);
        bool do_wakeup = device_may_wakeup(dev);
        int ret;
 
@@ -289,8 +288,7 @@ static int st_ohci_resume(struct device *dev)
 {
        struct usb_hcd *hcd = dev_get_drvdata(dev);
        struct usb_ohci_pdata *pdata = dev_get_platdata(dev);
-       struct platform_device *pdev =
-               container_of(dev, struct platform_device, dev);
+       struct platform_device *pdev = to_platform_device(dev);
        int err;
 
        if (pdata->power_on) {