From patchwork Fri Aug 19 13:48:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepthy Ravi X-Patchwork-Id: 1080292 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7JE9JBa020812 for ; Fri, 19 Aug 2011 14:09:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754587Ab1HSNtA (ORCPT ); Fri, 19 Aug 2011 09:49:00 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:38664 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754482Ab1HSNs5 (ORCPT ); Fri, 19 Aug 2011 09:48:57 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id p7JDmn7V004239 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 19 Aug 2011 08:48:51 -0500 Received: from dbde71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id p7JDmlgh021748; Fri, 19 Aug 2011 19:18:48 +0530 (IST) Received: from dbdp31.itg.ti.com (172.24.170.98) by DBDE71.ent.ti.com (172.24.170.149) with Microsoft SMTP Server id 8.3.106.1; Fri, 19 Aug 2011 19:18:47 +0530 Received: from localhost.localdomain (dbdp20.itg.ti.com [172.24.170.38]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id p7JDmj0v004013; Fri, 19 Aug 2011 19:18:46 +0530 (IST) From: Deepthy Ravi To: , , CC: , Vaibhav Hiremath , Deepthy Ravi Subject: [PATCHv2] ISP:BUILD:FIX: Move media_entity_init() and Date: Fri, 19 Aug 2011 19:18:45 +0530 Message-ID: <1313761725-6614-1-git-send-email-deepthy.ravi@ti.com> X-Mailer: git-send-email 1.6.2.4 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Fri, 19 Aug 2011 14:09:20 +0000 (UTC) From: Vaibhav Hiremath Fix the build break caused when CONFIG_MEDIA_CONTROLLER option is disabled and if any sensor driver has to be used between MC and non MC framework compatible devices. For example,if tvp514x video decoder driver migrated to MC framework is being built without CONFIG_MEDIA_CONTROLLER option enabled, the following error messages will result. drivers/built-in.o: In function `tvp514x_remove': drivers/media/video/tvp514x.c:1285: undefined reference to `media_entity_cleanup' drivers/built-in.o: In function `tvp514x_probe': drivers/media/video/tvp514x.c:1237: undefined reference to `media_entity_init' The file containing definitions of media_entity_init and media_entity_cleanup functions will not be built if that config option is disabled. And this is corrected by defining two dummy functions. Signed-off-by: Vaibhav Hiremath Signed-off-by: Deepthy Ravi --- include/media/media-entity.h | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/include/media/media-entity.h b/include/media/media-entity.h index cd8bca6..c90916e 100644 --- a/include/media/media-entity.h +++ b/include/media/media-entity.h @@ -121,9 +121,18 @@ struct media_entity_graph { int top; }; +#ifdef CONFIG_MEDIA_CONTROLLER int media_entity_init(struct media_entity *entity, u16 num_pads, struct media_pad *pads, u16 extra_links); void media_entity_cleanup(struct media_entity *entity); +#else +static inline int media_entity_init(struct media_entity *entity, u16 num_pads, + struct media_pad *pads, u16 extra_links) +{ + return 0; +} +static inline void media_entity_cleanup(struct media_entity *entity) {} +#endif int media_entity_create_link(struct media_entity *source, u16 source_pad, struct media_entity *sink, u16 sink_pad, u32 flags);