From patchwork Thu Sep 27 05:33:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 1511381 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 494033FDAE for ; Thu, 27 Sep 2012 05:34:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754809Ab2I0Fd4 (ORCPT ); Thu, 27 Sep 2012 01:33:56 -0400 Received: from mail-da0-f46.google.com ([209.85.210.46]:51943 "EHLO mail-da0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754638Ab2I0Fd4 (ORCPT ); Thu, 27 Sep 2012 01:33:56 -0400 Received: by dady13 with SMTP id y13so295594dad.19 for ; Wed, 26 Sep 2012 22:33:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=/8zOVYJSDz45LNeg3ZpyLw55o4FvW7aY/1PEnEJGfgQ=; b=eUs+eicKYhv+fFqHxxM0rEbAY7sfQB45sBqgEOQbBMnqvoKyh0GvKOakdnlC1jQT7R d9a5gRnTY8X2iBG7r6dPlQ1SL2+eNdYEr48kl3D478CGw+l+eKT05lIHVW+scb/cU11r 8ZqNQZIJHqoqGCtqm1c7hEUsZcpfa0Rq7P4+4M6mu7wjEi1cgZRQlBZtfqveyBjlAriR kVh73p2DxJzcFYVD9zg9rrhKPIIV602jS/wNpNzi2eOFCw68z4MMd2E6zT+A0dVpa+ky IqevB6dqGr6Ii8J7BUGqKPrvdvXEKh3384kQ9dhtNHKOef6pRgkQDS5vCxKoSvFC99MN TGOw== Received: by 10.68.130.67 with SMTP id oc3mr8566547pbb.18.1348724035496; Wed, 26 Sep 2012 22:33:55 -0700 (PDT) Received: from localhost.localdomain ([122.166.13.141]) by mx.google.com with ESMTPS id st6sm3255121pbc.58.2012.09.26.22.33.50 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 26 Sep 2012 22:33:54 -0700 (PDT) From: Prabhakar To: LMML Cc: DLOS , Manjunath Hadli , VGER , "Lad, Prabhakar" , Mauro Carvalho Chehab Subject: [PATCH v2] media: davinci: vpif: add check for NULL handler Date: Thu, 27 Sep 2012 11:03:12 +0530 Message-Id: <1348723992-3199-1-git-send-email-prabhakar.lad@ti.com> X-Mailer: git-send-email 1.7.4.1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Lad, Prabhakar for da850/omap-l138, there is no need to setup_input_channel_mode() and set_clock(), to avoid adding dummy code in board file just returning zero add a check in the driver itself to call the handler only if its not NULL. Signed-off-by: Lad, Prabhakar Signed-off-by: Manjunath Hadli Acked-by: Hans Verkuil Cc: Mauro Carvalho Chehab --- Changes for v2: 1: Added patch description, pointed by Mauro. drivers/media/platform/davinci/vpif_capture.c | 13 +++++++------ drivers/media/platform/davinci/vpif_display.c | 13 +++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c index 13aa46d..7b5e09a 100644 --- a/drivers/media/platform/davinci/vpif_capture.c +++ b/drivers/media/platform/davinci/vpif_capture.c @@ -311,12 +311,13 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count) } /* configure 1 or 2 channel mode */ - ret = vpif_config_data->setup_input_channel_mode - (vpif->std_info.ycmux_mode); - - if (ret < 0) { - vpif_dbg(1, debug, "can't set vpif channel mode\n"); - return ret; + if (vpif_config_data->setup_input_channel_mode) { + ret = vpif_config_data-> + setup_input_channel_mode(vpif->std_info.ycmux_mode); + if (ret < 0) { + vpif_dbg(1, debug, "can't set vpif channel mode\n"); + return ret; + } } /* Call vpif_set_params function to set the parameters and addresses */ diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c index e401aea..e8a0286 100644 --- a/drivers/media/platform/davinci/vpif_display.c +++ b/drivers/media/platform/davinci/vpif_display.c @@ -280,12 +280,13 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count) } /* clock settings */ - ret = - vpif_config_data->set_clock(ch->vpifparams.std_info.ycmux_mode, - ch->vpifparams.std_info.hd_sd); - if (ret < 0) { - vpif_err("can't set clock\n"); - return ret; + if (vpif_config_data->set_clock) { + ret = vpif_config_data->set_clock(ch->vpifparams.std_info. + ycmux_mode, ch->vpifparams.std_info.hd_sd); + if (ret < 0) { + vpif_err("can't set clock\n"); + return ret; + } } /* set the parameters and addresses */