From patchwork Fri Jun 5 20:11:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 6557831 Return-Path: X-Original-To: patchwork-linux-media@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 F3D389F3D1 for ; Fri, 5 Jun 2015 20:12:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 01ABE206FD for ; Fri, 5 Jun 2015 20:12:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 759E420689 for ; Fri, 5 Jun 2015 20:12:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752032AbbFEUL7 (ORCPT ); Fri, 5 Jun 2015 16:11:59 -0400 Received: from resqmta-po-07v.sys.comcast.net ([96.114.154.166]:46349 "EHLO resqmta-po-07v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751899AbbFEUL6 (ORCPT ); Fri, 5 Jun 2015 16:11:58 -0400 Received: from resomta-po-16v.sys.comcast.net ([96.114.154.240]) by resqmta-po-07v.sys.comcast.net with comcast id ckAw1q0015BUCh401kBxvQ; Fri, 05 Jun 2015 20:11:57 +0000 Received: from mail.gonehiking.org ([73.181.52.62]) by resomta-po-16v.sys.comcast.net with comcast id ckBx1q0021LXgTt01kBxpC; Fri, 05 Jun 2015 20:11:57 +0000 Received: from lorien.internal (lorien-wl.internal [192.168.1.40]) by mail.gonehiking.org (Postfix) with ESMTP id 9F5FD40078; Fri, 5 Jun 2015 14:11:56 -0600 (MDT) From: Shuah Khan To: mchehab@osg.samsung.com Cc: Shuah Khan , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: define Media Controller API when CONFIG_MEDIA_CONTROLLER enabled Date: Fri, 5 Jun 2015 14:11:54 -0600 Message-Id: <1433535114-5493-1-git-send-email-shuahkh@osg.samsung.com> X-Mailer: git-send-email 2.1.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1433535117; bh=9SV05dHCrqI+bBGg0z5lIDAu6pN794LyjKzKg8R69j0=; h=Received:Received:Received:From:To:Subject:Date:Message-Id; b=GL+vzWiT3YPq5QWiP0VwC2QpumCjAT+HC5dHGAcLVwLp3Ca2VBJHAT/WKOb/pN8YX Y6HuSbMPtB2K7jMksI1hemAviH+VvMvMTgx0MzWxwrNX2dkg8GfEJUbFdcAE5zpeQ3 U0jkfXPyNT1q8TPnQNdknt20lEclo8jXlHeduQXseAPTMdbXEQcHq0B+4xz5/+y5fm dSfWy3H4FcgSsG7DamFWVfSGfQjGm6Js5OvRPgOIOsHsJAXTCHYkZydoSZHjJ0NrGy e28VFwDU8V2C7Clwttzg4C8jlJuHZ9jsSVbcNR3Z83gaaZmKOv12YOb/nVeANKb/3F nUhU7VI0Av70A== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham 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 Change to define Media Controller API when CONFIG_MEDIA_CONTROLLER is enabled. Define stubs for CONFIG_MEDIA_CONTROLLER disabled case. This will help avoid drivers needing to enclose Media Controller code within ifdef CONFIG_MEDIA_CONTROLLER block. Signed-off-by: Shuah Khan --- drivers/media/media-device.c | 4 ++++ include/media/media-device.h | 27 +++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c index a4d5b24..c55ab50 100644 --- a/drivers/media/media-device.c +++ b/drivers/media/media-device.c @@ -30,6 +30,8 @@ #include #include +#ifdef CONFIG_MEDIA_CONTROLLER + /* ----------------------------------------------------------------------------- * Userspace API */ @@ -495,3 +497,5 @@ struct media_device *media_device_find_devres(struct device *dev) return devres_find(dev, media_device_release_devres, NULL, NULL); } EXPORT_SYMBOL_GPL(media_device_find_devres); + +#endif /* CONFIG_MEDIA_CONTROLLER */ diff --git a/include/media/media-device.h b/include/media/media-device.h index 22792cd..a44f18f 100644 --- a/include/media/media-device.h +++ b/include/media/media-device.h @@ -80,6 +80,8 @@ struct media_device { unsigned int notification); }; +#ifdef CONFIG_MEDIA_CONTROLLER + /* Supported link_notify @notification values. */ #define MEDIA_DEV_NOTIFY_PRE_LINK_CH 0 #define MEDIA_DEV_NOTIFY_POST_LINK_CH 1 @@ -102,4 +104,29 @@ struct media_device *media_device_find_devres(struct device *dev); #define media_device_for_each_entity(entity, mdev) \ list_for_each_entry(entity, &(mdev)->entities, list) +#else +static inline int media_device_register(struct media_device *mdev) +{ + return 0; +} +static inline void media_device_unregister(struct media_device *mdev) +{ +} +static inline int media_device_register_entity(struct media_device *mdev, + struct media_entity *entity) +{ + return 0; +} +static inline void media_device_unregister_entity(struct media_entity *entity) +{ +} +static inline struct media_device *media_device_get_devres(struct device *dev) +{ + return NULL; +} +static inline struct media_device *media_device_find_devres(struct device *dev) +{ + return NULL; +} +#endif /* CONFIG_MEDIA_CONTROLLER */ #endif