Re: [PATCH 1/3] PCI: add power-state name strings

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

 



On Monday 27 April 2009, Alan Stern wrote:
> This patch (as1235) adds an array of PCI power-state names, together
> with a simple inline accessor routine.

Good idea. :-)

Acked-by: Rafael J. Wysocki <rjw@xxxxxxx>

> Signed-off-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
> CC: Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx>
> 
> ---
> 
> Index: usb-2.6/drivers/pci/pci.c
> ===================================================================
> --- usb-2.6.orig/drivers/pci/pci.c
> +++ usb-2.6/drivers/pci/pci.c
> @@ -24,6 +24,11 @@
>  #include <asm/setup.h>
>  #include "pci.h"
>  
> +const char *pci_power_names[] = {
> +	"error", "D0", "D1", "D2", "D3hot", "D3cold", "unknown",
> +};
> +EXPORT_SYMBOL_GPL(pci_power_names);
> +
>  unsigned int pci_pm_d3_delay = PCI_PM_D3_WAIT;
>  
>  #ifdef CONFIG_PCI_DOMAINS
> Index: usb-2.6/include/linux/pci.h
> ===================================================================
> --- usb-2.6.orig/include/linux/pci.h
> +++ usb-2.6/include/linux/pci.h
> @@ -124,6 +124,14 @@ typedef int __bitwise pci_power_t;
>  #define PCI_UNKNOWN	((pci_power_t __force) 5)
>  #define PCI_POWER_ERROR	((pci_power_t __force) -1)
>  
> +/* Remember to update this when the list above changes! */
> +extern const char *pci_power_names[];
> +
> +static inline const char *pci_power_name(pci_power_t state)
> +{
> +	return pci_power_names[1 + (int) state];
> +}
> +
>  #define PCI_PM_D2_DELAY	200
>  #define PCI_PM_D3_WAIT	10
>  #define PCI_PM_BUS_WAIT	50
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux