From patchwork Thu Nov 26 07:50:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Zhong X-Patchwork-Id: 7704851 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0CCA09F1D3 for ; Thu, 26 Nov 2015 07:51:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 42E5320764 for ; Thu, 26 Nov 2015 07:51:01 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 75C1B20629 for ; Thu, 26 Nov 2015 07:51:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A494F6E7E9; Wed, 25 Nov 2015 23:50:59 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-io0-f179.google.com (mail-io0-f179.google.com [209.85.223.179]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0F3C06E7E9 for ; Wed, 25 Nov 2015 23:50:59 -0800 (PST) Received: by iouu10 with SMTP id u10so78780811iou.0 for ; Wed, 25 Nov 2015 23:50:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6prfIwfb4EdTe/0kR0FlWDZz0KdEFbyWGCypvKTCGSE=; b=Xuo5PC2zi89AIKwfyPXeTndpjkuOcJ9EzyJjfHpCCYTDZvTIgfZ3fc3awtE0P0KYvN yinX53KPDDHQxEXP3LaMlzOqItwktu3DB5vn+MLUJ6jkeOKcaac5+WyH+3qS6OysauYt hdDwNnnTccMHnJxhiTAeKnZXguonhy99bzrS+I+TBIuNfKxUVv/pAwIGu/HWPTeYrA+g ywI80LFslv8bH2vwUYksy6Y63qgDgqAZKeIv1/Iczonf00akMwuDHK5+0EOO9WJvbHol 5eGMtEP21AiO0ShNJuOQYpSPqKKTW4j2haG+WIoBtucCtD3s7ID7N56gdVSq+OdSbux2 9O0Q== X-Received: by 10.66.167.101 with SMTP id zn5mr58438804pab.48.1448524256875; Wed, 25 Nov 2015 23:50:56 -0800 (PST) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id w1sm25396819pfa.57.2015.11.25.23.50.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Nov 2015 23:50:56 -0800 (PST) From: Chris Zhong To: heiko@sntech.de, linux-rockchip@lists.infradead.org, mark.yao@rock-chips.com, treding@nvidia.com Subject: [PATCH v5 05/11] drm: bridge: allow some funcs to be optional Date: Thu, 26 Nov 2015 15:50:19 +0800 Message-Id: <1448524225-5489-6-git-send-email-zyw@rock-chips.com> X-Mailer: git-send-email 2.6.3 In-Reply-To: <1448524225-5489-1-git-send-email-zyw@rock-chips.com> References: <1448524225-5489-1-git-send-email-zyw@rock-chips.com> Cc: Chris Zhong , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org 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: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.2 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 Check the validity of post_disable/pre_enable in bridge->funcs before call them. Signed-off-by: Chris Zhong --- Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None drivers/gpu/drm/drm_bridge.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index 6b8f721..8f29330 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -223,7 +223,8 @@ void drm_bridge_post_disable(struct drm_bridge *bridge) if (!bridge) return; - bridge->funcs->post_disable(bridge); + if (bridge->funcs->post_disable) + bridge->funcs->post_disable(bridge); drm_bridge_post_disable(bridge->next); } @@ -273,7 +274,8 @@ void drm_bridge_pre_enable(struct drm_bridge *bridge) drm_bridge_pre_enable(bridge->next); - bridge->funcs->pre_enable(bridge); + if (bridge->funcs->pre_enable) + bridge->funcs->pre_enable(bridge); } EXPORT_SYMBOL(drm_bridge_pre_enable);