Commit a1f763fe authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Jani Nikula

drm/i915/dsi: Get rid of redundant 'else'

In the snippets like the following

	if (...)
		return / goto / break / continue ...;
	else
		...

the 'else' is redundant. Get rid of it.
Reviewed-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarJani Nikula <jani.nikula@intel.com>
Tested-by: default avatarHans de Goede <hdegoede@redhat.com>
Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231103201831.1037416-8-andriy.shevchenko@linux.intel.com
parent 1c8953b2
...@@ -142,7 +142,7 @@ static enum port intel_dsi_seq_port_to_port(struct intel_dsi *intel_dsi, ...@@ -142,7 +142,7 @@ static enum port intel_dsi_seq_port_to_port(struct intel_dsi *intel_dsi,
if (seq_port) { if (seq_port) {
if (intel_dsi->ports & BIT(PORT_B)) if (intel_dsi->ports & BIT(PORT_B))
return PORT_B; return PORT_B;
else if (intel_dsi->ports & BIT(PORT_C)) if (intel_dsi->ports & BIT(PORT_C))
return PORT_C; return PORT_C;
} }
...@@ -670,8 +670,8 @@ static const char *sequence_name(enum mipi_seq seq_id) ...@@ -670,8 +670,8 @@ static const char *sequence_name(enum mipi_seq seq_id)
{ {
if (seq_id < ARRAY_SIZE(seq_name) && seq_name[seq_id]) if (seq_id < ARRAY_SIZE(seq_name) && seq_name[seq_id])
return seq_name[seq_id]; return seq_name[seq_id];
else
return "(unknown)"; return "(unknown)";
} }
static void intel_dsi_vbt_exec(struct intel_dsi *intel_dsi, static void intel_dsi_vbt_exec(struct intel_dsi *intel_dsi,
...@@ -865,36 +865,34 @@ bool intel_dsi_vbt_init(struct intel_dsi *intel_dsi, u16 panel_id) ...@@ -865,36 +865,34 @@ bool intel_dsi_vbt_init(struct intel_dsi *intel_dsi, u16 panel_id)
* multiply by 100 to preserve remainder * multiply by 100 to preserve remainder
*/ */
if (intel_dsi->video_mode == BURST_MODE) { if (intel_dsi->video_mode == BURST_MODE) {
if (mipi_config->target_burst_mode_freq) { u32 bitrate;
u32 bitrate = intel_dsi_bitrate(intel_dsi);
/*
* Sometimes the VBT contains a slightly lower clock,
* then the bitrate we have calculated, in this case
* just replace it with the calculated bitrate.
*/
if (mipi_config->target_burst_mode_freq < bitrate &&
intel_fuzzy_clock_check(
mipi_config->target_burst_mode_freq,
bitrate))
mipi_config->target_burst_mode_freq = bitrate;
if (mipi_config->target_burst_mode_freq < bitrate) {
drm_err(&dev_priv->drm,
"Burst mode freq is less than computed\n");
return false;
}
burst_mode_ratio = DIV_ROUND_UP( if (mipi_config->target_burst_mode_freq == 0) {
mipi_config->target_burst_mode_freq * 100, drm_err(&dev_priv->drm, "Burst mode target is not set\n");
bitrate); return false;
}
intel_dsi->pclk = DIV_ROUND_UP(intel_dsi->pclk * burst_mode_ratio, 100); bitrate = intel_dsi_bitrate(intel_dsi);
} else {
drm_err(&dev_priv->drm, /*
"Burst mode target is not set\n"); * Sometimes the VBT contains a slightly lower clock, then
* the bitrate we have calculated, in this case just replace it
* with the calculated bitrate.
*/
if (mipi_config->target_burst_mode_freq < bitrate &&
intel_fuzzy_clock_check(mipi_config->target_burst_mode_freq,
bitrate))
mipi_config->target_burst_mode_freq = bitrate;
if (mipi_config->target_burst_mode_freq < bitrate) {
drm_err(&dev_priv->drm, "Burst mode freq is less than computed\n");
return false; return false;
} }
burst_mode_ratio =
DIV_ROUND_UP(mipi_config->target_burst_mode_freq * 100, bitrate);
intel_dsi->pclk = DIV_ROUND_UP(intel_dsi->pclk * burst_mode_ratio, 100);
} else } else
burst_mode_ratio = 100; burst_mode_ratio = 100;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment