Add helper for accessing Power Management callbacs
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest8 patches 17 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | driver core: Add helper for accessing Power Management callbacsinclude/ | +15 | 3 replies | |
| 2/8 | ACPI: PM: Use the new device_to_pm() helper to access struct dev_pm_opsdrivers/ | +3 | 3 replies | |
| 3/8 | greybus: Use the new device_to_pm() helper to access struct dev_pm_opsdrivers/ | +2 | 1 reply | |
| 4/8 | scsi: pm: Use the new device_to_pm() helper to access struct dev_pm_opsdrivers/ | +4 | 0 replies | |
| 5/8 | usb: phy: fsl: Use the new device_to_pm() helper to access struct dev_pm_opsdrivers/ | +7 | 1 reply | |
| 6/8 | PCI/PM: Use the new device_to_pm() helper to access struct dev_pm_opsdrivers/ | +16 | 0 replies | |
| 7/8 | PM: Use the new device_to_pm() helper to access struct dev_pm_opsdrivers/ drivers/ drivers/ +1 more | +73 | 1 reply | |
| 8/8 | net/iucv: Use the new device_to_pm() helper to access struct dev_pm_opsnet/ | +18 | 8 replies |
Reviews trailers per patch
1 of 8 patches has a Reviewed-by or Acked-by.
| Patch | Alex Elder |
|---|---|
| 1/8 | |
| 2/8 | |
| 3/8 | R-b |
| 4/8 | |
| 5/8 | |
| 6/8 | |
| 7/8 | |
| 8/8 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/8] Add helper for accessing Power Management callbacs
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/[email protected]/
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(-)
Signature · 1 line
2.26.2