Skip to contentSkip to conversation

PCI/PM: Removing the function pci_pm_complete()

PATCH Applied Chuansheng Liu 3 participants 4 messages Sep 10, 2013 – Oct 7, 2013 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI/PM: Removing the function pci_pm_complete()

Commit(88d2613) removed the pm_runtime_put_sync() from pci_pm_complete() to PM core code device_complete().

Here the pci_pm_complete() is doing the same work which can be done in device_complete(), so we can remove it directly.

---
 drivers/pci/pci-driver.c |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)
drivers/pci/pci-driver.c +0 -9
index 98f7b9b..736ef3f 100644
@@ -599,18 +599,10 @@ static int pci_pm_prepare(struct device *dev)
 	return error;
 }
 
-static void pci_pm_complete(struct device *dev)
-{
-	struct device_driver *drv = dev->driver;
-
-	if (drv && drv->pm && drv->pm->complete)
-		drv->pm->complete(dev);
-}
 
 #else /* !CONFIG_PM_SLEEP */
 
 #define pci_pm_prepare	NULL
-#define pci_pm_complete	NULL
 
 #endif /* !CONFIG_PM_SLEEP */
 
@@ -1123,7 +1115,6 @@ static int pci_pm_runtime_idle(struct device *dev)
 
 const struct dev_pm_ops pci_dev_pm_ops = {
 	.prepare = pci_pm_prepare,
-	.complete = pci_pm_complete,
 	.suspend = pci_pm_suspend,
 	.resume = pci_pm_resume,
 	.freeze = pci_pm_freeze,
Signature · 1 line
1.7.0.4
maintainer
#1 lore raw
Quoted 11 lines · Chuansheng Liu

Commit(88d2613) removed the pm_runtime_put_sync() from pci_pm_complete() to PM core code device_complete().

Here the pci_pm_complete() is doing the same work which can be done in device_complete(), so we can remove it directly.

---
 drivers/pci/pci-driver.c |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)

This looks correct to me, but I'd like Rafael to ack it before I apply it.

Quoted 36 lines
drivers/pci/pci-driver.c +0 -10
index 98f7b9b..736ef3f 100644
@@ -599,18 +599,10 @@ static int pci_pm_prepare(struct device *dev)
        return error;
 }
 
-static void pci_pm_complete(struct device *dev)
-{
-       struct device_driver *drv = dev->driver;
-
-       if (drv && drv->pm && drv->pm->complete)
-               drv->pm->complete(dev);
-}
 
 #else /* !CONFIG_PM_SLEEP */
 
 #define pci_pm_prepare NULL
-#define pci_pm_complete        NULL
 
 #endif /* !CONFIG_PM_SLEEP */
 
@@ -1123,7 +1115,6 @@ static int pci_pm_runtime_idle(struct device *dev)
 
 const struct dev_pm_ops pci_dev_pm_ops = {
        .prepare = pci_pm_prepare,
-       .complete = pci_pm_complete,
        .suspend = pci_pm_suspend,
        .resume = pci_pm_resume,
        .freeze = pci_pm_freeze,
--

1.7.0.4

#2 lore raw
Quoted 9 lines · Bjorn Helgaas
Quoted 7 lines · Chuansheng Liu

Commit(88d2613) removed the pm_runtime_put_sync() from pci_pm_complete() to PM core code device_complete().

Here the pci_pm_complete() is doing the same work which can be done in device_complete(), so we can remove it directly.

Quoted 6 lines
Quoted 4 lines
---
 drivers/pci/pci-driver.c |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)

This looks correct to me, but I'd like Rafael to ack it before I apply it.

Yes, it should work, so ACK.

Sorry for the delay.

Quoted 25 lines
Quoted 25 lines
drivers/pci/pci-driver.c +0 -8
index 98f7b9b..736ef3f 100644
@@ -599,18 +599,10 @@ static int pci_pm_prepare(struct device *dev)
        return error;
 }
 
-static void pci_pm_complete(struct device *dev)
-{
-       struct device_driver *drv = dev->driver;
-
-       if (drv && drv->pm && drv->pm->complete)
-               drv->pm->complete(dev);
-}
 
 #else /* !CONFIG_PM_SLEEP */
 
 #define pci_pm_prepare NULL
-#define pci_pm_complete        NULL
 
 #endif /* !CONFIG_PM_SLEEP */
 
@@ -1123,7 +1115,6 @@ static int pci_pm_runtime_idle(struct device *dev)
 
Quoted 8 lines
Quoted 8 lines
drivers/pci/pci-driver.c +0 -2
 const struct dev_pm_ops pci_dev_pm_ops = {
        .prepare = pci_pm_prepare,
-       .complete = pci_pm_complete,
        .suspend = pci_pm_suspend,
        .resume = pci_pm_resume,
        .freeze = pci_pm_freeze,
--

1.7.0.4

Thanks!

Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
maintainer Applied
#3 lore raw
In reply to Chuansheng Liu
Quoted 8 lines · Chuansheng Liu

Commit(88d2613) removed the pm_runtime_put_sync() from pci_pm_complete() to PM core code device_complete().

Here the pci_pm_complete() is doing the same work which can be done in device_complete(), so we can remove it directly.

Applied to pci/misc with Rafaels' ack, for v3.13. Thanks!

Bjorn

Quoted 40 lines
---
 drivers/pci/pci-driver.c |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)
drivers/pci/pci-driver.c +0 -10
index 98f7b9b..736ef3f 100644
@@ -599,18 +599,10 @@ static int pci_pm_prepare(struct device *dev)
        return error;
 }
 
-static void pci_pm_complete(struct device *dev)
-{
-       struct device_driver *drv = dev->driver;
-
-       if (drv && drv->pm && drv->pm->complete)
-               drv->pm->complete(dev);
-}
 
 #else /* !CONFIG_PM_SLEEP */
 
 #define pci_pm_prepare NULL
-#define pci_pm_complete        NULL
 
 #endif /* !CONFIG_PM_SLEEP */
 
@@ -1123,7 +1115,6 @@ static int pci_pm_runtime_idle(struct device *dev)
 
 const struct dev_pm_ops pci_dev_pm_ops = {
        .prepare = pci_pm_prepare,
-       .complete = pci_pm_complete,
        .suspend = pci_pm_suspend,
        .resume = pci_pm_resume,
        .freeze = pci_pm_freeze,
--

1.7.0.4