diff mbox series

[3/4] drm/i915: Make i830 .get_cdclk() assignment less confusing

Message ID 20200714152626.380-3-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series [1/4] drm/i915: Pack struct intel_cdclk_vals | expand

Commit Message

Ville Syrjälä July 14, 2020, 3:26 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Explicitly check for i830 when assigning the .get_cdclk() vfunc,
and then deal with the case of not having assigned the vfunc
separately. Less confusing, and gets rid of the checkpatch complaint
about using {} on one branch but not the others.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_cdclk.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

Chris Wilson July 14, 2020, 4:45 p.m. UTC | #1
Quoting Ville Syrjala (2020-07-14 16:26:25)
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Explicitly check for i830 when assigning the .get_cdclk() vfunc,
> and then deal with the case of not having assigned the vfunc
> separately. Less confusing, and gets rid of the checkpatch complaint
> about using {} on one branch but not the others.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c b/drivers/gpu/drm/i915/display/intel_cdclk.c
index 72095ef14426..9d6cacbdb691 100644
--- a/drivers/gpu/drm/i915/display/intel_cdclk.c
+++ b/drivers/gpu/drm/i915/display/intel_cdclk.c
@@ -2903,9 +2903,10 @@  void intel_init_cdclk_hooks(struct drm_i915_private *dev_priv)
 		dev_priv->display.get_cdclk = i85x_get_cdclk;
 	else if (IS_I845G(dev_priv))
 		dev_priv->display.get_cdclk = fixed_200mhz_get_cdclk;
-	else { /* 830 */
-		drm_WARN(&dev_priv->drm, !IS_I830(dev_priv),
-			 "Unknown platform. Assuming 133 MHz CDCLK\n");
+	else if (IS_I830(dev_priv))
+		dev_priv->display.get_cdclk = fixed_133mhz_get_cdclk;
+
+	if (drm_WARN(&dev_priv->drm, !dev_priv->display.get_cdclk,
+		     "Unknown platform. Assuming 133 MHz CDCLK\n"))
 		dev_priv->display.get_cdclk = fixed_133mhz_get_cdclk;
-	}
 }