Skip to content

Commit

Permalink
PCI / PM: Remove unnecessary error variable from acpi_dev_run_wake()
Browse files Browse the repository at this point in the history
The result returned by acpi_dev_run_wake() is always either -EINVAL
or -ENODEV, while obviously it should return 0 on success.  The
problem is that the leftover error variable, that's not really used
in the function, is initialized with -ENODEV and then returned
without modification.

To fix this issue remove the error variable from acpi_dev_run_wake()
and make the function return 0 on success as appropriate.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
  • Loading branch information
Rafael J. Wysocki authored and Jesse Barnes committed Oct 14, 2011
1 parent 6af8bef commit 78d090b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/pci/pci-acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,6 @@ static int acpi_dev_run_wake(struct device *phys_dev, bool enable)
{
struct acpi_device *dev;
acpi_handle handle;
int error = -ENODEV;

if (!device_run_wake(phys_dev))
return -EINVAL;
Expand All @@ -305,7 +304,7 @@ static int acpi_dev_run_wake(struct device *phys_dev, bool enable)
acpi_disable_wakeup_device_power(dev);
}

return error;
return 0;
}

static void acpi_pci_propagate_run_wake(struct pci_bus *bus, bool enable)
Expand Down

0 comments on commit 78d090b

Please sign in to comment.