All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] Add helper for accessing Power Management callbacs
@ 2020-05-25 18:26 Krzysztof Wilczyński
  2020-05-25 18:26 ` [PATCH 1/8] driver core: " Krzysztof Wilczyński
                   ` (7 more replies)
  0 siblings, 8 replies; 30+ messages in thread
From: Krzysztof Wilczyński @ 2020-05-25 18:26 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Rafael J. Wysocki, Len Brown, Kevin Hilman, Ulf Hansson,
	Pavel Machek, Greg Kroah-Hartman, Johan Hovold, Alex Elder,
	Bjorn Helgaas, James E.J. Bottomley, Martin K. Petersen,
	Felipe Balbi, Julian Wiedmann, Karsten Graul, Ursula Braun,
	Jakub Kicinski, Bjorn Andersson, John Stultz, David S. Miller,
	greybus-dev, netdev, linux-acpi, linux-pci, linux-pm, linux-s390,
	linux-scsi, linux-usb

This series aims to add a new driver_to_pm() helper allowing for
accessing the Power Management callbacs for a particular device.

Access to the callbacs (struct dev_pm_ops) is normally done through
using the pm pointer that is embedded within the device_driver struct.

This new helper allows for the code required to reference the pm pointer
and access Power Management callbas to be simplified.  Changing the
following:

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

To:

  const struct dev_pm_ops *pm = driver_to_pm(dev->driver);
  if (pm && pm->prepare) {
      int ret = pm->prepare(dev);

Or, changing the following:

     const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;

To:
     const struct dev_pm_ops *pm = driver_to_pm(dev->driver);

This series builds on top of the previous commit 6da2f2ccfd2d ("PCI/PM:
Make power management op coding style consistent") that had an aim to
make accessing the Power Managemnet callbacs more consistent.

No functional change intended.

Links:
  https://lore.kernel.org/driverdev-devel/20191014230016.240912-6-helgaas@kernel.org/
  https://lore.kernel.org/driverdev-devel/8592302.r4xC6RIy69@kreacher/
  https://lore.kernel.org/driverdev-devel/20191016135002.GA24678@kadam/

Krzysztof Wilczyński (8):
  driver core: Add helper for accessing Power Management callbacs
  ACPI: PM: Use the new device_to_pm() helper to access struct
    dev_pm_ops
  greybus: Use the new device_to_pm() helper to access struct dev_pm_ops
  scsi: pm: Use the new device_to_pm() helper to access struct
    dev_pm_ops
  usb: phy: fsl: Use the new device_to_pm() helper to access struct
    dev_pm_ops
  PCI/PM: Use the new device_to_pm() helper to access struct dev_pm_ops
  PM: Use the new device_to_pm() helper to access struct dev_pm_ops
  net/iucv: Use the new device_to_pm() helper to access struct
    dev_pm_ops

 drivers/acpi/device_pm.c         |  5 ++-
 drivers/base/power/domain.c      | 12 ++++--
 drivers/base/power/generic_ops.c | 65 ++++++++++++++------------------
 drivers/base/power/main.c        | 48 +++++++++++++++--------
 drivers/base/power/runtime.c     |  7 ++--
 drivers/greybus/bundle.c         |  4 +-
 drivers/pci/pci-driver.c         | 32 ++++++++--------
 drivers/scsi/scsi_pm.c           |  8 ++--
 drivers/usb/phy/phy-fsl-usb.c    | 11 ++++--
 include/linux/device/driver.h    | 15 ++++++++
 net/iucv/iucv.c                  | 30 +++++++++------
 11 files changed, 138 insertions(+), 99 deletions(-)

-- 
2.26.2


^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2020-05-26 16:48 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-25 18:26 [PATCH 0/8] Add helper for accessing Power Management callbacs Krzysztof Wilczyński
2020-05-25 18:26 ` [PATCH 1/8] driver core: " Krzysztof Wilczyński
2020-05-26  6:33   ` Greg Kroah-Hartman
2020-05-26 11:53     ` [greybus-dev] " Alex Elder
2020-05-26 15:01       ` Krzysztof Wilczyński
2020-05-25 18:26 ` [PATCH 2/8] ACPI: PM: Use the new device_to_pm() helper to access struct dev_pm_ops Krzysztof Wilczyński
2020-05-26  8:37   ` Rafael J. Wysocki
2020-05-26  8:37     ` Rafael J. Wysocki
2020-05-26  9:45     ` Pavel Machek
2020-05-26 10:35       ` Rafael J. Wysocki
2020-05-25 18:26 ` [PATCH 3/8] greybus: " Krzysztof Wilczyński
2020-05-26 11:53   ` [greybus-dev] " Alex Elder
2020-05-25 18:26 ` [PATCH 4/8] scsi: pm: " Krzysztof Wilczyński
2020-05-25 18:26 ` [PATCH 5/8] usb: phy: fsl: " Krzysztof Wilczyński
2020-05-26  8:38   ` Rafael J. Wysocki
2020-05-26  8:38     ` Rafael J. Wysocki
2020-05-25 18:26 ` [PATCH 6/8] PCI/PM: " Krzysztof Wilczyński
2020-05-25 18:26 ` [PATCH 7/8] PM: " Krzysztof Wilczyński
2020-05-26  8:33   ` Rafael J. Wysocki
2020-05-26  8:33     ` Rafael J. Wysocki
2020-05-25 18:26 ` [PATCH 8/8] net/iucv: " Krzysztof Wilczyński
2020-05-26  6:35   ` Greg Kroah-Hartman
2020-05-26 15:07     ` Krzysztof Wilczyński
2020-05-26 15:19       ` Rafael J. Wysocki
2020-05-26 15:19         ` Rafael J. Wysocki
2020-05-26 15:28         ` Alan Stern
2020-05-26 16:06           ` Rafael J. Wysocki
2020-05-26 16:48       ` [greybus-dev] " Alex Elder
2020-05-26  7:07   ` Ursula Braun
2020-05-26 14:57     ` Krzysztof Wilczyński

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.