pci-driver.c (6e9041c6ddd6cbdc61d87bcaca8ca7bb17c28377) | pci-driver.c (45f0a85c8258741d11bda25c0a5669c06267204a) |
---|---|
1/* 2 * drivers/pci/pci-driver.c 3 * 4 * (C) Copyright 2002-2004, 2007 Greg Kroah-Hartman <greg@kroah.com> 5 * (C) Copyright 2007 Novell Inc. 6 * 7 * Released under the GPL v2 only. 8 * --- 1036 unchanged lines hidden (view full) --- 1045 1046 return rc; 1047} 1048 1049static int pci_pm_runtime_idle(struct device *dev) 1050{ 1051 struct pci_dev *pci_dev = to_pci_dev(dev); 1052 const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; | 1/* 2 * drivers/pci/pci-driver.c 3 * 4 * (C) Copyright 2002-2004, 2007 Greg Kroah-Hartman <greg@kroah.com> 5 * (C) Copyright 2007 Novell Inc. 6 * 7 * Released under the GPL v2 only. 8 * --- 1036 unchanged lines hidden (view full) --- 1045 1046 return rc; 1047} 1048 1049static int pci_pm_runtime_idle(struct device *dev) 1050{ 1051 struct pci_dev *pci_dev = to_pci_dev(dev); 1052 const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; |
1053 int ret = 0; |
|
1053 1054 /* 1055 * If pci_dev->driver is not set (unbound), the device should 1056 * always remain in D0 regardless of the runtime PM status 1057 */ 1058 if (!pci_dev->driver) | 1054 1055 /* 1056 * If pci_dev->driver is not set (unbound), the device should 1057 * always remain in D0 regardless of the runtime PM status 1058 */ 1059 if (!pci_dev->driver) |
1059 goto out; | 1060 return 0; |
1060 1061 if (!pm) 1062 return -ENOSYS; 1063 | 1061 1062 if (!pm) 1063 return -ENOSYS; 1064 |
1064 if (pm->runtime_idle) { 1065 int ret = pm->runtime_idle(dev); 1066 if (ret) 1067 return ret; 1068 } | 1065 if (pm->runtime_idle) 1066 ret = pm->runtime_idle(dev); |
1069 | 1067 |
1070out: 1071 pm_runtime_suspend(dev); 1072 return 0; | 1068 return ret; |
1073} 1074 1075#else /* !CONFIG_PM_RUNTIME */ 1076 1077#define pci_pm_runtime_suspend NULL 1078#define pci_pm_runtime_resume NULL 1079#define pci_pm_runtime_idle NULL 1080 --- 220 unchanged lines hidden --- | 1069} 1070 1071#else /* !CONFIG_PM_RUNTIME */ 1072 1073#define pci_pm_runtime_suspend NULL 1074#define pci_pm_runtime_resume NULL 1075#define pci_pm_runtime_idle NULL 1076 --- 220 unchanged lines hidden --- |