drm/i915: use for_each_port_masked in bxt phy init for clarity
authorJani Nikula <jani.nikula@intel.com>
Fri, 1 Apr 2016 07:44:41 +0000 (10:44 +0300)
committerImre Deak <imre.deak@intel.com>
Fri, 1 Apr 2016 10:39:32 +0000 (13:39 +0300)
Make it easier to see which ports are configured for each phy. No
functional changes.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1459496681-398-1-git-send-email-jani.nikula@intel.com
drivers/gpu/drm/i915/intel_ddi.c

index 3d62b601188f55ec4bd8d932007156e1dfbd2aaf..2758622a5c2d01d721c67b9e150e778793ebb575 100644 (file)
@@ -1726,7 +1726,7 @@ static void broxton_phy_init(struct drm_i915_private *dev_priv,
                             enum dpio_phy phy)
 {
        enum port port;
-       uint32_t val;
+       u32 ports, val;
 
        val = I915_READ(BXT_P_CR_GT_DISP_PWRON);
        val |= GT_DISPLAY_POWER_ON(phy);
@@ -1745,8 +1745,12 @@ static void broxton_phy_init(struct drm_i915_private *dev_priv,
                DRM_ERROR("timeout during PHY%d power on\n", phy);
        }
 
-       for (port =  (phy == DPIO_PHY0 ? PORT_B : PORT_A);
-            port <= (phy == DPIO_PHY0 ? PORT_C : PORT_A); port++) {
+       if (phy == DPIO_PHY0)
+               ports = BIT(PORT_B) | BIT(PORT_C);
+       else
+               ports = BIT(PORT_A);
+
+       for_each_port_masked(port, ports) {
                int lane;
 
                for (lane = 0; lane < 4; lane++) {