]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/bios: move aux ch and ddc checks at a lower level
authorJani Nikula <jani.nikula@intel.com>
Wed, 17 Mar 2021 16:36:43 +0000 (18:36 +0200)
committerJani Nikula <jani.nikula@intel.com>
Thu, 18 Mar 2021 12:42:58 +0000 (14:42 +0200)
Unify the code paths at the higher level.

Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/44559ef456015f65a863c3d89a9bea9157d13a05.1615998927.git.jani.nikula@intel.com
drivers/gpu/drm/i915/display/intel_bios.c

index c2572459dfdf3e351edbb58400426026635638a7..38084589c105c8165c37c3b6569e1202698fa6de 100644 (file)
@@ -1505,6 +1505,9 @@ static enum port get_port_by_ddc_pin(struct drm_i915_private *i915, u8 ddc_pin)
        const struct ddi_vbt_port_info *info;
        enum port port;
 
+       if (!ddc_pin)
+               return PORT_NONE;
+
        for_each_port(port) {
                info = &i915->vbt.ddi_port_info[port];
 
@@ -1521,9 +1524,6 @@ static void sanitize_ddc_pin(struct drm_i915_private *i915,
        struct ddi_vbt_port_info *info = &i915->vbt.ddi_port_info[port];
        enum port p;
 
-       if (!info->alternate_ddc_pin)
-               return;
-
        p = get_port_by_ddc_pin(i915, info->alternate_ddc_pin);
        if (p == PORT_NONE)
                return;
@@ -1555,6 +1555,9 @@ static enum port get_port_by_aux_ch(struct drm_i915_private *i915, u8 aux_ch)
        const struct ddi_vbt_port_info *info;
        enum port port;
 
+       if (!aux_ch)
+               return PORT_NONE;
+
        for_each_port(port) {
                info = &i915->vbt.ddi_port_info[port];
 
@@ -1571,9 +1574,6 @@ static void sanitize_aux_ch(struct drm_i915_private *i915,
        struct ddi_vbt_port_info *info = &i915->vbt.ddi_port_info[port];
        enum port p;
 
-       if (!info->alternate_aux_channel)
-               return;
-
        p = get_port_by_aux_ch(i915, info->alternate_aux_channel);
        if (p == PORT_NONE)
                return;