mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
PCI PM: Simplify PCI wake-up code
Rework the PCI wake-up code so that it's easier to read without changing the functionality. Reviewed-by: Matthew Garrett <mjg59@srcf.ucam.org> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
This commit is contained in:
parent
748df9a4c6
commit
5bcc2fb4e8
2 changed files with 21 additions and 14 deletions
|
@ -111,12 +111,16 @@ static bool acpi_pci_can_wakeup(struct pci_dev *dev)
|
|||
|
||||
static int acpi_pci_sleep_wake(struct pci_dev *dev, bool enable)
|
||||
{
|
||||
int error = acpi_pm_device_sleep_wake(&dev->dev, enable);
|
||||
int error;
|
||||
|
||||
if (!acpi_pci_can_wakeup(dev))
|
||||
return 0;
|
||||
|
||||
error = acpi_pm_device_sleep_wake(&dev->dev, enable);
|
||||
if (!error)
|
||||
dev_printk(KERN_INFO, &dev->dev,
|
||||
"wake-up capability %s by ACPI\n",
|
||||
dev_info(&dev->dev, "wake-up capability %s by ACPI\n",
|
||||
enable ? "enabled" : "disabled");
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue