Skip to contentSkip to conversation

drm/bridge: analogix_dp: Drop dead error check for analogix_dp_init_analog_func()

PATCH New Xiangwu Lai 1 participant 1 message Nov 11

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

PATCH v3 1/1 drm/bridge: analogix_dp: Drop dead error check for analogix_dp_init_analog_func()

analogix_dp_init_analog_func() cannot fail: since commit 917c8d192ba6ad ("drm/bridge: analogix_dp: don't wait for PLL lock too early") removed the PLL lock polling loop, the function only performs register writes and always returns 0. The error check on its return value in analogix_dp_set_bridge() is therefore dead code.

Drop the dead check and make the function void.

---
Changes in v3:

- Use the real name "Xiangwu Lai" for the author and in the Signed-off-by trailer instead of the account handle, as noted by the Sashiko AI review (Developer's Certificate of Origin).

Changes in v2:

- Rework the patch completely. The v1 fixed the runtime PM reference leak on the analogix_dp_init_analog_func() failure path, but as noted in the Sashiko AI review that path is unreachable: since 917c8d192ba6ad ("drm/bridge: analogix_dp: don't wait for PLL lock too early") removed the PLL lock polling loop, the function only performs register writes and always returns 0. Instead of keeping a fix for an unreachable path, drop the dead error check and make the function void.

 drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 4 +---
 drivers/gpu/drm/bridge/analogix/analogix_dp_core.h | 2 +-
 drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c  | 3 +--
 3 files changed, 3 insertions(+), 6 deletions(-)
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +1 -3
index 6df696374..5b1b05d24 100644
@@ -996,9 +996,7 @@ static int analogix_dp_set_bridge(struct analogix_dp_device *dp)
 
 	pm_runtime_get_sync(dp->dev);
 
-	ret = analogix_dp_init_analog_func(dp);
-	if (ret)
-		return ret;
+	analogix_dp_init_analog_func(dp);
 
 	/*
 	 * According to DP spec v1.3 chap 3.5.1.2 Link Training,
drivers/gpu/drm/bridge/analogix/analogix_dp_core.h +1 -1
index 456059760..440007e22 100644
@@ -192,7 +192,7 @@ void analogix_dp_set_pll_power_down(struct analogix_dp_device *dp, bool enable);
 void analogix_dp_set_analog_power_down(struct analogix_dp_device *dp,
 				       enum analog_power_block block,
 				       bool enable);
-int analogix_dp_init_analog_func(struct analogix_dp_device *dp);
+void analogix_dp_init_analog_func(struct analogix_dp_device *dp);
 void analogix_dp_init_hpd(struct analogix_dp_device *dp);
 void analogix_dp_force_hpd(struct analogix_dp_device *dp);
 enum dp_irq_type analogix_dp_get_irq_type(struct analogix_dp_device *dp);
drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c +1 -2
index c1344a3f0..3d196cf96 100644
@@ -351,7 +351,7 @@ void analogix_dp_set_analog_power_down(struct analogix_dp_device *dp,
 	}
 }
 
-int analogix_dp_init_analog_func(struct analogix_dp_device *dp)
+void analogix_dp_init_analog_func(struct analogix_dp_device *dp)
 {
 	u32 reg;
 
@@ -372,7 +372,6 @@ int analogix_dp_init_analog_func(struct analogix_dp_device *dp)
 	reg &= ~(SERDES_FIFO_FUNC_EN_N | LS_CLK_DOMAIN_FUNC_EN_N
 		| AUX_FUNC_EN_N);
 	writel(reg, dp->reg_base + ANALOGIX_DP_FUNC_EN_2);
-	return 0;
 }
 
 void analogix_dp_clear_hotplug_interrupts(struct analogix_dp_device *dp)
Signature · 1 line
2.50.1.windows.1