]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: Documentation: Use right function to test device power state
authorSakari Ailus <sakari.ailus@linux.intel.com>
Thu, 26 Mar 2026 10:42:49 +0000 (12:42 +0200)
committerSakari Ailus <sakari.ailus@linux.intel.com>
Wed, 6 May 2026 09:40:10 +0000 (12:40 +0300)
Tell driver authors to use pm_runtime_get_if_active() instead of
pm_runtime_get_if_in_use() to check the device's power state in the s_ctrl
callback. pm_runtime_get_if_active() is the right function to use here
since it returns non-zero if the device is powered on rather than its
PM runtime usage_count is non-zero.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Documentation/driver-api/media/camera-sensor.rst

index 94bd1dae82d5c570b2d11c7faee20dd45d2f4be6..c8552f70f4961306ea65358693d32ce6af020ebd 100644 (file)
@@ -114,7 +114,7 @@ of the device. This is because the power state of the device is only changed
 after the power state transition has taken place. The ``s_ctrl`` callback can be
 used to obtain device's power state after the power state transition:
 
-.. c:function:: int pm_runtime_get_if_in_use(struct device *dev);
+.. c:function:: int pm_runtime_get_if_active(struct device *dev);
 
 The function returns a non-zero value if it succeeded getting the power count or
 runtime PM was disabled, in either of which cases the driver may proceed to