drm: fixes when i2c encoder slave mode_fixup is null.
authorCarlos Palminha <CARLOS.PALMINHA@synopsys.com>
Wed, 10 Feb 2016 12:08:38 +0000 (12:08 +0000)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 10 Feb 2016 14:14:49 +0000 (15:14 +0100)
Avoid i2c slave encoder drivers to copy/paste code to implement functions that will
only return true.

Signed-off-by: Carlos Palminha <palminha@synopsys.com>
[danvet: whitespace requested by Jani.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1455106118-32145-1-git-send-email-palminha@synopsys.com
drivers/gpu/drm/drm_encoder_slave.c

index e8629076de32161a82d3103b772ce198f5c4e59e..4484785cd9ac22a45fd8a2dcf95d54d2e22fde99 100644 (file)
@@ -140,6 +140,9 @@ bool drm_i2c_encoder_mode_fixup(struct drm_encoder *encoder,
                const struct drm_display_mode *mode,
                struct drm_display_mode *adjusted_mode)
 {
+       if (!get_slave_funcs(encoder)->mode_fixup)
+               return true;
+
        return get_slave_funcs(encoder)->mode_fixup(encoder, mode, adjusted_mode);
 }
 EXPORT_SYMBOL(drm_i2c_encoder_mode_fixup);