]> git.baikalelectronics.ru Git - kernel.git/commit
PCI/PM: Make power management op coding style consistent
authorBjorn Helgaas <bhelgaas@google.com>
Mon, 14 Oct 2019 18:46:50 +0000 (13:46 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 20 Nov 2019 23:33:32 +0000 (17:33 -0600)
commitf6e06284a91e10f13eb4f23af38b48e62a8e4989
treeaf2ccaf5fb046d23c278b9d2e42e2251bde78877
parente926ac5a813b3786c17b0769caaac29836ce31d0
PCI/PM: Make power management op coding style consistent

Some of the power management ops use this style:

  struct device_driver *drv = dev->driver;
  if (drv && drv->pm && drv->pm->prepare(dev))
    drv->pm->prepare(dev);

while others use this:

  const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
  if (pm && pm->runtime_resume)
    pm->runtime_resume(dev);

Convert the first style to the second so they're all consistent.  Remove
local "error" variables when unnecessary.  No functional change intended.

Link: https://lore.kernel.org/r/20191014230016.240912-6-helgaas@kernel.org
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/pci/pci-driver.c