Re: [RFC][PATCH 2/3] PCI PM: Introduce platform_pci_power_manageable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2008-06-17 at 02:14 +0200, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rjw@xxxxxxx>
> 
> Introduce function pointer platform_pci_power_manageable to be used
> by the platform-related code to point to a function allowing us to
> check if given device is power manageable by the platform.
> 
> Introduce acpi_pci_power_manageable() playing that role for ACPI.
> 
> Signed-off-by: Rafael J. Wysocki <rjw@xxxxxxx>
> ---
>  drivers/pci/pci-acpi.c |   11 +++++++++++
>  drivers/pci/pci.c      |    1 +
>  drivers/pci/pci.h      |    1 +
>  3 files changed, 13 insertions(+)
> 
> Index: linux-2.6/drivers/pci/pci-acpi.c
> ===================================================================
> --- linux-2.6.orig/drivers/pci/pci-acpi.c
> +++ linux-2.6/drivers/pci/pci-acpi.c
> @@ -315,6 +315,16 @@ static pci_power_t acpi_pci_choose_state
>  }
>  #endif
> 
> +static bool acpi_pci_power_manageable(struct pci_dev *dev)
> +{
> +	acpi_handle handle = DEVICE_ACPI_HANDLE(&dev->dev);
> +
> +	if (!handle)
> +		return -ENODEV;

Seems like a bad idea to pass non-true/false values using a bool.
Wouldn't an int return type be more appropriate here?

<snip>

Cheers,
	-Matt Helsley

_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm

[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux