lkml.org 
[lkml]   [2019]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 5/5] PCI: PM: Fold __pci_complete_power_transition() into its caller
On Tue, Nov 5, 2019 at 5:09 PM Christoph Hellwig <hch@infradead.org> wrote:
>
> 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;

Yes, that looks better, thanks!

I'll send an update of this patch.

\
 
 \ /
  Last update: 2019-11-05 17:15    [W:0.042 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site