From patchwork Wed Jan 23 22:21:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sylwester Nawrocki X-Patchwork-Id: 2027011 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 2FA38DF23E for ; Wed, 23 Jan 2013 22:22:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752274Ab3AWWWU (ORCPT ); Wed, 23 Jan 2013 17:22:20 -0500 Received: from mail-ee0-f43.google.com ([74.125.83.43]:41034 "EHLO mail-ee0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750899Ab3AWWWS (ORCPT ); Wed, 23 Jan 2013 17:22:18 -0500 Received: by mail-ee0-f43.google.com with SMTP id c50so4212401eek.30 for ; Wed, 23 Jan 2013 14:22:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=4Pw8UUCQGxEHXDARzF0OQbLA5PGCVD4pz5KgtvzOAvo=; b=W9qXmI/MdW9umsRSUSP1bBF1lAIHB/1nA9w2ak06DeauLBCc+TUphQ3UFKGI+uiRGc 8+gQf8Pt2AB1Yj5cvrri9lQdz6KlAu8qPkv4hiq2K3GX38ORm7tHWP17XKvnIb91XNex RRqws3fk/ykC9nC5fsd2t9568N3PjATzPkUwVrG8QQNbnQI9GOkl24dKtUZcxysUlzhX whTX9bUgoLOhMIFPFAI9ecDlxYRZHPTIJj6ue08MmGGfGXmhccmd+H1R5LzOHT3pegni MnoEBz70aj1pi2OB0BJhyZ1l5hs3oQvpy81JRYndVO5BZriqArW4iG0GYl9LjN+yj6d2 YZxA== X-Received: by 10.14.202.3 with SMTP id c3mr8674186eeo.4.1358979736895; Wed, 23 Jan 2013 14:22:16 -0800 (PST) Received: from localhost.localdomain (031011138205.warszawa.vectranet.pl. [31.11.138.205]) by mx.google.com with ESMTPS id f49sm32606042eep.12.2013.01.23.14.22.15 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 23 Jan 2013 14:22:16 -0800 (PST) From: Sylwester Nawrocki To: linux-media@vger.kernel.org Cc: hverkuil@xs4all.nl, laurent.pinchart@ideasonboard.com, sylvester.nawrocki@gmail.com Subject: [PATCH RFC v3 3/6] V4L: Add v4l2_event_subdev_unsubscribe() helper function Date: Wed, 23 Jan 2013 23:21:58 +0100 Message-Id: <1358979721-17473-4-git-send-email-sylvester.nawrocki@gmail.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1358979721-17473-1-git-send-email-sylvester.nawrocki@gmail.com> References: <1358979721-17473-1-git-send-email-sylvester.nawrocki@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add a v4l2 core helper function that can be used as the subdev .unsubscribe_event handler. This allows to eliminate some boilerplate from drivers that are only handling the control events. Signed-off-by: Sylwester Nawrocki --- drivers/media/v4l2-core/v4l2-event.c | 7 +++++++ include/media/v4l2-event.h | 4 +++- 2 files changed, 10 insertions(+), 1 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-event.c b/drivers/media/v4l2-core/v4l2-event.c index c720092..86dcb54 100644 --- a/drivers/media/v4l2-core/v4l2-event.c +++ b/drivers/media/v4l2-core/v4l2-event.c @@ -311,3 +311,10 @@ int v4l2_event_unsubscribe(struct v4l2_fh *fh, return 0; } EXPORT_SYMBOL_GPL(v4l2_event_unsubscribe); + +int v4l2_event_subdev_unsubscribe(struct v4l2_subdev *sd, struct v4l2_fh *fh, + struct v4l2_event_subscription *sub) +{ + return v4l2_event_unsubscribe(fh, sub); +} +EXPORT_SYMBOL_GPL(v4l2_event_subdev_unsubscribe); diff --git a/include/media/v4l2-event.h b/include/media/v4l2-event.h index eff85f9..be05d01 100644 --- a/include/media/v4l2-event.h +++ b/include/media/v4l2-event.h @@ -64,6 +64,7 @@ */ struct v4l2_fh; +struct v4l2_subdev; struct v4l2_subscribed_event; struct video_device; @@ -129,5 +130,6 @@ int v4l2_event_subscribe(struct v4l2_fh *fh, int v4l2_event_unsubscribe(struct v4l2_fh *fh, const struct v4l2_event_subscription *sub); void v4l2_event_unsubscribe_all(struct v4l2_fh *fh); - +int v4l2_event_subdev_unsubscribe(struct v4l2_subdev *sd, struct v4l2_fh *fh, + struct v4l2_event_subscription *sub); #endif /* V4L2_EVENT_H */