Re: [PATCH 5/5] PCI: PM: Fold __pci_complete_power_transition() into its caller

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

 



On Tue, Nov 05, 2019 at 11:32:02AM +0100, Rafael J. Wysocki wrote:
>  	if (state > PCI_D3cold)
> @@ -1132,10 +1112,12 @@ int pci_set_power_state(struct pci_dev *
>  	error = pci_raw_set_power_state(dev, state > PCI_D3hot ?
>  					PCI_D3hot : state);
>  
> -	if (!__pci_complete_power_transition(dev, state))
> -		error = 0;
> +	ret = pci_platform_power_transition(dev, state);
> +	/* Powering off a bridge may power off the whole hierarchy */
> +	if (!ret && state == PCI_D3cold)
> +		pci_bus_set_current_state(dev->subordinate, PCI_D3cold);
>  
> -	return error;
> +	return ret ? error : 0;

Total nitpick, but why not:

	if (pci_platform_power_transition(dev, state))
		return error;

	/* Powering off a bridge may power off the whole hierarchy */
	if (state == PCI_D3cold)
		pci_bus_set_current_state(dev->subordinate, PCI_D3cold);
	return 0;




[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