drm: probe_helper: Hide ugly ifdef
authorEzequiel Garcia <ezequiel@vanguardiasur.com.ar>
Tue, 19 Apr 2016 17:40:37 +0000 (14:40 -0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 20 Apr 2016 11:35:14 +0000 (13:35 +0200)
Push the ifdef to the drm_edid.h and create a stub, for the
DRM_LOAD_EDID_FIRMWARE=n case. This removes some clutter in
the code, making it more readable.

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1461087638-16959-1-git-send-email-ezequiel@vanguardiasur.com.ar
drivers/gpu/drm/drm_probe_helper.c
include/drm/drm_edid.h

index e714b5a7955f4fa7a8da56970d5dc2684182130a..0329080d7f7cb5410a1d903a606d6a38d1b0c74e 100644 (file)
@@ -264,10 +264,8 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
                count = drm_add_edid_modes(connector, edid);
                drm_edid_to_eld(connector, edid);
        } else {
-#ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE
                count = drm_load_edid_firmware(connector);
                if (count == 0)
-#endif
                        count = (*connector_funcs->get_modes)(connector);
        }
 
index dec6221e819801a674cde431bb8f9b5c50b23b80..919933d1beb42241e233e9332a99911eeaa4c9cd 100644 (file)
@@ -328,7 +328,15 @@ int drm_edid_to_speaker_allocation(struct edid *edid, u8 **sadb);
 int drm_av_sync_delay(struct drm_connector *connector,
                      const struct drm_display_mode *mode);
 struct drm_connector *drm_select_eld(struct drm_encoder *encoder);
+
+#ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE
 int drm_load_edid_firmware(struct drm_connector *connector);
+#else
+static inline int drm_load_edid_firmware(struct drm_connector *connector)
+{
+       return 0;
+}
+#endif
 
 int
 drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,