summaryrefslogtreecommitdiff
path: root/drivers/usb/host/ohci-platform.c
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@163.com>2015-12-23 16:26:52 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-01-25 08:00:33 +0300
commit20db5513b4085d4beb78e7129cf7e56fe4ddafde (patch)
treed77929e8be4add3032a33a75254cf06eacd3019e /drivers/usb/host/ohci-platform.c
parent6ae706aeaf42cd2fe6e541c72af6e2c0befe057c (diff)
downloadlinux-20db5513b4085d4beb78e7129cf7e56fe4ddafde.tar.xz
USB: host: use to_platform_device
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>
Diffstat (limited to 'drivers/usb/host/ohci-platform.c')
-rw-r--r--drivers/usb/host/ohci-platform.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c
index c2669f185f65..ae1c988da146 100644
--- a/drivers/usb/host/ohci-platform.c
+++ b/drivers/usb/host/ohci-platform.c
@@ -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);