From patchwork Sun Dec 13 11:01:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 7838971 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 28851BEEE5 for ; Sun, 13 Dec 2015 11:02:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D29BF20379 for ; Sun, 13 Dec 2015 11:02:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E48D120361 for ; Sun, 13 Dec 2015 11:02:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751784AbbLMLCE (ORCPT ); Sun, 13 Dec 2015 06:02:04 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:38521 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751750AbbLMLB7 (ORCPT ); Sun, 13 Dec 2015 06:01:59 -0500 Received: from 177.17.248.210.dynamic.adsl.gvt.net.br ([177.17.248.210] helo=smtp.w2.samsung.com) by bombadil.infradead.org with esmtpsa (Exim 4.80.1 #2 (Red Hat Linux)) id 1a84Pe-0006zl-CH; Sun, 13 Dec 2015 11:01:58 +0000 Received: from mchehab by smtp.w2.samsung.com with local (Exim 4.86) (envelope-from ) id 1a84PQ-0006Tl-M7; Sun, 13 Dec 2015 09:01:44 -0200 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab Subject: [PATCH 2/4] [media] media-device.h: document the last functions Date: Sun, 13 Dec 2015 09:01:41 -0200 Message-Id: <68bf3676b7c185a90552b41b7b984f3eb37cee49.1450004500.git.mchehab@osg.samsung.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: References: In-Reply-To: References: To: unlisted-recipients:; (no To-header on input) 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 Add kernel-doc documentation for media_device_get_devres and media_device_find_devres. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/media-device.c | 7 ------- include/media/media-device.h | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c index c12481c753a0..ca16bd3091bd 100644 --- a/drivers/media/media-device.c +++ b/drivers/media/media-device.c @@ -689,10 +689,6 @@ static void media_device_release_devres(struct device *dev, void *res) { } -/* - * media_device_get_devres() - get media device as device resource - * creates if one doesn't exist -*/ struct media_device *media_device_get_devres(struct device *dev) { struct media_device *mdev; @@ -709,9 +705,6 @@ struct media_device *media_device_get_devres(struct device *dev) } EXPORT_SYMBOL_GPL(media_device_get_devres); -/* - * media_device_find_devres() - find media device as device resource -*/ struct media_device *media_device_find_devres(struct device *dev) { return devres_find(dev, media_device_release_devres, NULL, NULL); diff --git a/include/media/media-device.h b/include/media/media-device.h index b0594be5d631..0c3611d1abea 100644 --- a/include/media/media-device.h +++ b/include/media/media-device.h @@ -449,7 +449,29 @@ int __must_check media_device_register_entity(struct media_device *mdev, * the driver if required. */ void media_device_unregister_entity(struct media_entity *entity); + +/** + * media_device_get_devres() - get media device as device resource + * creates if one doesn't exist + * + * @dev: pointer to struct &device. + * + * Sometimes, the media controller &media_device needs to be shared by more + * than one driver. This function adds support for that, by dynamically + * allocating the &media_device and allowing it to be obtained from the + * struct &device associated with the common device where all sub-device + * components belong. So, for example, on an USB device with multiple + * interfaces, each interface may be handled by a separate per-interface + * drivers. While each interface have its own &device, they all share a + * common &device associated with the hole USB device. + */ struct media_device *media_device_get_devres(struct device *dev); + +/** + * media_device_find_devres() - find media device as device resource + * + * @dev: pointer to struct &device. + */ struct media_device *media_device_find_devres(struct device *dev); /* Iterate over all entities. */