From patchwork Wed Feb 10 12:08:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Palminha X-Patchwork-Id: 8270691 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1AC0ABEEE5 for ; Wed, 10 Feb 2016 12:20:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 47EA22037F for ; Wed, 10 Feb 2016 12:20:29 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5C34B20364 for ; Wed, 10 Feb 2016 12:20:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 938246E6B6; Wed, 10 Feb 2016 04:20:26 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtprelay.synopsys.com (smtprelay.synopsys.com [198.182.60.111]) by gabe.freedesktop.org (Postfix) with ESMTPS id C58996E07B for ; Wed, 10 Feb 2016 04:09:09 -0800 (PST) Received: from us02secmta2.synopsys.com (us02secmta2.synopsys.com [10.12.235.98]) by smtprelay.synopsys.com (Postfix) with ESMTP id 0D3D410C0C3B; Wed, 10 Feb 2016 04:09:08 -0800 (PST) Received: from us02secmta2.internal.synopsys.com (us02secmta2.internal.synopsys.com [127.0.0.1]) by us02secmta2.internal.synopsys.com (Service) with ESMTP id 00DE255F15; Wed, 10 Feb 2016 04:09:08 -0800 (PST) Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by us02secmta2.internal.synopsys.com (Service) with ESMTP id CDC4555F14; Wed, 10 Feb 2016 04:09:07 -0800 (PST) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id BC2B21F8; Wed, 10 Feb 2016 04:09:07 -0800 (PST) Received: from US01WEHTC3.internal.synopsys.com (us01wehtc3.internal.synopsys.com [10.15.84.232]) by mailhost.synopsys.com (Postfix) with ESMTP id CADF11F6; Wed, 10 Feb 2016 04:09:06 -0800 (PST) Received: from DE02WEHTCA.internal.synopsys.com (10.225.19.92) by US01WEHTC3.internal.synopsys.com (10.15.84.232) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 10 Feb 2016 04:09:06 -0800 Received: from DE02WEHTCB.internal.synopsys.com (10.225.19.94) by DE02WEHTCA.internal.synopsys.com (10.225.19.92) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 10 Feb 2016 13:09:04 +0100 Received: from palminha-vm.internal.synopsys.com (10.107.25.139) by DE02WEHTCB.internal.synopsys.com (10.225.19.80) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 10 Feb 2016 13:09:04 +0100 From: Carlos Palminha To: , Daniel Vetter , Lars-Peter Clausen , Laurent Pinchart Subject: [PATCH] drm: fixes when i2c encoder slave mode_fixup is null. Date: Wed, 10 Feb 2016 12:08:38 +0000 Message-ID: <1455106118-32145-1-git-send-email-palminha@synopsys.com> X-Mailer: git-send-email 2.5.0 MIME-Version: 1.0 X-Originating-IP: [10.107.25.139] X-Mailman-Approved-At: Wed, 10 Feb 2016 04:20:25 -0800 Cc: CARLOS.PALMINHA@synopsys.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Avoid i2c slave encoder drivers to copy/paste code to implement functions that will only return true. Signed-off-by: Carlos Palminha --- drivers/gpu/drm/drm_encoder_slave.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.5.0 diff --git a/drivers/gpu/drm/drm_encoder_slave.c b/drivers/gpu/drm/drm_encoder_slave.c index e862907..418b94c 100644 --- a/drivers/gpu/drm/drm_encoder_slave.c +++ b/drivers/gpu/drm/drm_encoder_slave.c @@ -140,6 +140,8 @@ 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);