aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@163.com>2015-12-23 08:26:52 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-01-25 00:00:33 -0500
commit20db5513b4085d4beb78e7129cf7e56fe4ddafde (patch)
treed77929e8be4add3032a33a75254cf06eacd3019e
parent6ae706aeaf42cd2fe6e541c72af6e2c0befe057c (diff)
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>
-rw-r--r--drivers/usb/host/ehci-platform.c6
-rw-r--r--drivers/usb/host/ehci-st.c6
-rw-r--r--drivers/usb/host/ohci-platform.c6
-rw-r--r--drivers/usb/host/ohci-st.c6
4 files changed, 8 insertions, 16 deletions
diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c
index bd7082f297bb..1757ebb471b6 100644
--- a/drivers/usb/host/ehci-platform.c
+++ b/drivers/usb/host/ehci-platform.c
@@ -345,8 +345,7 @@ static int ehci_platform_suspend(struct device *dev)
345{ 345{
346 struct usb_hcd *hcd = dev_get_drvdata(dev); 346 struct usb_hcd *hcd = dev_get_drvdata(dev);
347 struct usb_ehci_pdata *pdata = dev_get_platdata(dev); 347 struct usb_ehci_pdata *pdata = dev_get_platdata(dev);
348 struct platform_device *pdev = 348 struct platform_device *pdev = to_platform_device(dev);
349 container_of(dev, struct platform_device, dev);
350 bool do_wakeup = device_may_wakeup(dev); 349 bool do_wakeup = device_may_wakeup(dev);
351 int ret; 350 int ret;
352 351
@@ -364,8 +363,7 @@ static int ehci_platform_resume(struct device *dev)
364{ 363{
365 struct usb_hcd *hcd = dev_get_drvdata(dev); 364 struct usb_hcd *hcd = dev_get_drvdata(dev);
366 struct usb_ehci_pdata *pdata = dev_get_platdata(dev); 365 struct usb_ehci_pdata *pdata = dev_get_platdata(dev);
367 struct platform_device *pdev = 366 struct platform_device *pdev = to_platform_device(dev);
368 container_of(dev, struct platform_device, dev);
369 struct ehci_platform_priv *priv = hcd_to_ehci_priv(hcd); 367 struct ehci_platform_priv *priv = hcd_to_ehci_priv(hcd);
370 368
371 if (pdata->power_on) { 369 if (pdata->power_on) {
diff --git a/drivers/usb/host/ehci-st.c b/drivers/usb/host/ehci-st.c
index b7c5cfa37a83..a94ed677d937 100644
--- a/drivers/usb/host/ehci-st.c
+++ b/drivers/usb/host/ehci-st.c
@@ -287,8 +287,7 @@ static int st_ehci_suspend(struct device *dev)
287{ 287{
288 struct usb_hcd *hcd = dev_get_drvdata(dev); 288 struct usb_hcd *hcd = dev_get_drvdata(dev);
289 struct usb_ehci_pdata *pdata = dev_get_platdata(dev); 289 struct usb_ehci_pdata *pdata = dev_get_platdata(dev);
290 struct platform_device *pdev = 290 struct platform_device *pdev = to_platform_device(dev);
291 container_of(dev, struct platform_device, dev);
292 bool do_wakeup = device_may_wakeup(dev); 291 bool do_wakeup = device_may_wakeup(dev);
293 int ret; 292 int ret;
294 293
@@ -308,8 +307,7 @@ static int st_ehci_resume(struct device *dev)
308{ 307{
309 struct usb_hcd *hcd = dev_get_drvdata(dev); 308 struct usb_hcd *hcd = dev_get_drvdata(dev);
310 struct usb_ehci_pdata *pdata = dev_get_platdata(dev); 309 struct usb_ehci_pdata *pdata = dev_get_platdata(dev);
311 struct platform_device *pdev = 310 struct platform_device *pdev = to_platform_device(dev);
312 container_of(dev, struct platform_device, dev);
313 int err; 311 int err;
314 312
315 pinctrl_pm_select_default_state(dev); 313 pinctrl_pm_select_default_state(dev);
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)
310{ 310{
311 struct usb_hcd *hcd = dev_get_drvdata(dev); 311 struct usb_hcd *hcd = dev_get_drvdata(dev);
312 struct usb_ohci_pdata *pdata = dev->platform_data; 312 struct usb_ohci_pdata *pdata = dev->platform_data;
313 struct platform_device *pdev = 313 struct platform_device *pdev = to_platform_device(dev);
314 container_of(dev, struct platform_device, dev);
315 bool do_wakeup = device_may_wakeup(dev); 314 bool do_wakeup = device_may_wakeup(dev);
316 int ret; 315 int ret;
317 316
@@ -329,8 +328,7 @@ static int ohci_platform_resume(struct device *dev)
329{ 328{
330 struct usb_hcd *hcd = dev_get_drvdata(dev); 329 struct usb_hcd *hcd = dev_get_drvdata(dev);
331 struct usb_ohci_pdata *pdata = dev_get_platdata(dev); 330 struct usb_ohci_pdata *pdata = dev_get_platdata(dev);
332 struct platform_device *pdev = 331 struct platform_device *pdev = to_platform_device(dev);
333 container_of(dev, struct platform_device, dev);
334 332
335 if (pdata->power_on) { 333 if (pdata->power_on) {
336 int err = pdata->power_on(pdev); 334 int err = pdata->power_on(pdev);
diff --git a/drivers/usb/host/ohci-st.c b/drivers/usb/host/ohci-st.c
index df9028e0d9b4..acf2eb2a5676 100644
--- a/drivers/usb/host/ohci-st.c
+++ b/drivers/usb/host/ohci-st.c
@@ -270,8 +270,7 @@ static int st_ohci_suspend(struct device *dev)
270{ 270{
271 struct usb_hcd *hcd = dev_get_drvdata(dev); 271 struct usb_hcd *hcd = dev_get_drvdata(dev);
272 struct usb_ohci_pdata *pdata = dev->platform_data; 272 struct usb_ohci_pdata *pdata = dev->platform_data;
273 struct platform_device *pdev = 273 struct platform_device *pdev = to_platform_device(dev);
274 container_of(dev, struct platform_device, dev);
275 bool do_wakeup = device_may_wakeup(dev); 274 bool do_wakeup = device_may_wakeup(dev);
276 int ret; 275 int ret;
277 276
@@ -289,8 +288,7 @@ static int st_ohci_resume(struct device *dev)
289{ 288{
290 struct usb_hcd *hcd = dev_get_drvdata(dev); 289 struct usb_hcd *hcd = dev_get_drvdata(dev);
291 struct usb_ohci_pdata *pdata = dev_get_platdata(dev); 290 struct usb_ohci_pdata *pdata = dev_get_platdata(dev);
292 struct platform_device *pdev = 291 struct platform_device *pdev = to_platform_device(dev);
293 container_of(dev, struct platform_device, dev);
294 int err; 292 int err;
295 293
296 if (pdata->power_on) { 294 if (pdata->power_on) {