Skip to contentSkip to conversation

drm/bridge: it6505: Fix return value check for pm_runtime_get_sync

PATCH Applied Pin-yen Lin 3 participants 3 messages Oct 27, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/bridge: it6505: Fix return value check for pm_runtime_get_sync

pm_runtime_get_sync may return 1 on success. Fix the if statement here to make the code less confusing, even though additional calls to it6505_poweron doesn't break anything when it's already powered.

This was reported by Dan Carpenter <[email protected]> in
https://lore.kernel.org/all/Y1fMCs6VnxbDcB41@kili/

Fixes 10517777d302 ("drm/bridge: it6505: Adapt runtime power management framework")

---

 drivers/gpu/drm/bridge/ite-it6505.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/ite-it6505.c +1 -1
index b929fc766e24..21a9b8422bda 100644
@@ -2699,7 +2699,7 @@ static void it6505_extcon_work(struct work_struct *work)
 		 * pm_runtime_force_resume re-enables runtime power management.
 		 * Handling the error here to make sure the bridge is powered on.
 		 */
-		if (ret)
+		if (ret < 0)
 			it6505_poweron(it6505);
 
 		complete_all(&it6505->extcon_completion);
Signature · 1 line
2.38.0.135.g90850a2211-goog
Reviewed-by on v1 1/1
#1 lore raw

Il 27/10/22 05:21, Pin-yen Lin ha scritto:

Quoted 10 lines

pm_runtime_get_sync may return 1 on success. Fix the if statement here to make the code less confusing, even though additional calls to it6505_poweron doesn't break anything when it's already powered.

This was reported by Dan Carpenter <[email protected]> in
https://lore.kernel.org/all/Y1fMCs6VnxbDcB41@kili/

Fixes 10517777d302 ("drm/bridge: it6505: Adapt runtime power management framework")
maintainer Applied
#2 lore raw
In reply to Pin-yen Lin

Hi,

Quoted 8 lines · Pin-yen Lin

pm_runtime_get_sync may return 1 on success. Fix the if statement here to make the code less confusing, even though additional calls to it6505_poweron doesn't break anything when it's already powered.

This was reported by Dan Carpenter <[email protected]> in
https://lore.kernel.org/all/Y1fMCs6VnxbDcB41@kili/

[...]

Thanks, Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-next)

[1/1] drm/bridge: it6505: Fix return value check for pm_runtime_get_sync

      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=3e4a21a29dd924995f1135cd50e8b7e0d023729c
Signature · 1 line
Neil