Re: [RFC][PATCH 6/10] PCI PM: Rearrange code in pci-driver.c

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

 



Hi!

> Rename two functions and rearrange code in drivers/pci/pci-driver.c
> so that it's easier to follow.  In particular, separate invocations
> of the legacy callbacks from the rest of the new callbacks' code.
> 
> No functional changes should result from this.
> 
> Signed-off-by: Rafael J. Wysocki <rjw@xxxxxxx>
> ---
>  drivers/pci/pci-driver.c |  104 +++++++++++++++++++++++++++++------------------
>  1 file changed, 65 insertions(+), 39 deletions(-)
>

> @@ -504,17 +504,21 @@ static int pci_pm_suspend(struct device 
>  	struct device_driver *drv = dev->driver;
>  	int error = 0;
>  
> +	if (pci_has_legacy_pm_support(pci_dev)) {
> +		error = pci_legacy_suspend(dev, PMSG_SUSPEND);
> +		goto Exit;
> +	}
> +
>  	if (drv && drv->pm) {
>  		if (drv->pm->suspend) {
>  			error = drv->pm->suspend(dev);
>  			suspend_report_result(drv->pm->suspend, error);
>  		}
> -	} else if (pci_has_legacy_pm_support(pci_dev)) {
> -		error = pci_legacy_suspend(dev, PMSG_SUSPEND);
>  	} else {
>  		pci_pm_default_suspend(pci_dev);
>  	}
>

Does this mean that pci_has_legacy_pm_support() => !(drv && drv->pm) ?
Should pci_has_legacy_pm_support() check for that and WARN() in case
both sets of callbacks are set?
									Pavel


-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
_______________________________________________
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