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: 1511401 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by patchwork1.kernel.org (Postfix) with ESMTP id CA78F3FDAE for ; Thu, 27 Sep 2012 05:35:36 +0000 (UTC) Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id q8R5Y0tr030345; Thu, 27 Sep 2012 00:34:00 -0500 Received: from DLEE74.ent.ti.com (dlee74.ent.ti.com [157.170.170.8]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8R5Y0td001550; Thu, 27 Sep 2012 00:34:00 -0500 Received: from dlelxv24.itg.ti.com (172.17.1.199) by DLEE74.ent.ti.com (157.170.170.8) with Microsoft SMTP Server id 14.1.323.3; Thu, 27 Sep 2012 00:33:59 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8R5XxHR027212; Thu, 27 Sep 2012 00:33:59 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 76C2280627; Thu, 27 Sep 2012 00:33:59 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp51.itg.ti.com (dflp51.itg.ti.com [128.247.22.94]) by linux.omap.com (Postfix) with ESMTP id BBD7180626 for ; Thu, 27 Sep 2012 00:33:57 -0500 (CDT) Received: from medina.ext.ti.com (medina.ext.ti.com [192.91.81.31]) by dflp51.itg.ti.com (8.13.7/8.13.8) with ESMTP id q8R5XvmG022360 for ; Thu, 27 Sep 2012 00:33:57 -0500 (CDT) Received: from psmtp.com (na3sys009amx183.postini.com [74.125.149.164]) by medina.ext.ti.com (8.13.7/8.13.7) with SMTP id q8R5XuTx030984 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 27 Sep 2012 00:33:56 -0500 Received: from mail-pb0-f45.google.com ([209.85.160.45]) (using TLSv1) by na3sys009amx183.postini.com ([74.125.148.10]) with SMTP; Thu, 27 Sep 2012 05:33:56 GMT Received: by pbbrp2 with SMTP id rp2so3033828pbb.4 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 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 X-pstn-levels: (S:99.90000/99.90000 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 ) X-pstn-dkim: 1 skipped:not-enabled X-pstn-settings: 2 (0.5000:0.0050) s cv GT3 gt2 gt1 r p m c X-pstn-addresses: from [82/3] CC: DLOS , Mauro Carvalho Chehab , VGER X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com 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 */