From patchwork Tue Jul 19 15:56:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Shyti X-Patchwork-Id: 9237783 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2CAAD600CB for ; Tue, 19 Jul 2016 15:58:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D7132624C for ; Tue, 19 Jul 2016 15:58:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1257426B4A; Tue, 19 Jul 2016 15:58:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9361D2624C for ; Tue, 19 Jul 2016 15:58:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753681AbcGSP5x (ORCPT ); Tue, 19 Jul 2016 11:57:53 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:36786 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753782AbcGSP5Q (ORCPT ); Tue, 19 Jul 2016 11:57:16 -0400 Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OAK029QYKB7HD50@mailout1.samsung.com>; Wed, 20 Jul 2016 00:57:07 +0900 (KST) Received: from epcpsbgm1new.samsung.com ( [172.20.52.112]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id BD.E7.05161.3DD4E875; Wed, 20 Jul 2016 00:57:07 +0900 (KST) X-AuditID: cbfee68f-f79476d000001429-cf-578e4dd312f1 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id F4.BA.02101.3DD4E875; Wed, 20 Jul 2016 00:57:07 +0900 (KST) Received: from samsunx.samsung ([10.113.63.54]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OAK006NUKB4PH70@mmp1.samsung.com>; Wed, 20 Jul 2016 00:57:07 +0900 (KST) From: Andi Shyti To: Mauro Carvalho Chehab , Sean Young Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Andi Shyti , Andi Shyti Subject: [RFC 4/7] [media] rc-ir-raw: do not generate any receiving thread for raw transmitters Date: Wed, 20 Jul 2016 00:56:55 +0900 Message-id: <1468943818-26025-5-git-send-email-andi.shyti@samsung.com> X-Mailer: git-send-email 2.8.1 In-reply-to: <1468943818-26025-1-git-send-email-andi.shyti@samsung.com> References: <1468943818-26025-1-git-send-email-andi.shyti@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrCLMWRmVeSWpSXmKPExsWyRsSkQPeyb1+4we+3mhbbjzxjtVj84zmT xeVdc9gsejZsZbVY/azCYuHT7ywObB7Xl3xi9ljyxtpjS/9ddo++LasYPT5vkgtgjeKySUnN ySxLLdK3S+DKWPa2n6XgBGfF4j1v2BoYn7N3MXJySAiYSLy8u4oRwhaTuHBvPVsXIxeHkMAK RonvbRvhiqaduM0MkVjKKNH97jAThPORUWLn0VNMIFVsApoSTbd/sIHYIgL+Em96FrOC2MwC zYwSu68bgdjCAokSH+ZOAKthEVCV+H/vDVgNr4CbxM7lr1ghtslJXJ7+AKiGg4NTwF3iys0i kLAQUMm7dQ9ZQPZKCExml9j+5Q0TxBwBiW+TD7GA1EsIyEpsOsAMMUZ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3rB7qIt2ex//p3BBRfbh1miBpsLEryt0sj7L MT1Ms0+R7+Q8leLGUxNebtyzsI7V1tCwIHLe8q63C4TfXVJ3tzRaw/r8dGCcv/0a4ddfYjTv e59sFi5nndRWeGndHlvf12ohU5YXfv8pZnGxfJujEktxRqKhFnNRcSIAwQ9g3LQCAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Raw IR transmitters do not need any thread listening for occurring events. Check the driver type before running the thread. Signed-off-by: Andi Shyti --- drivers/media/rc/rc-ir-raw.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/media/rc/rc-ir-raw.c b/drivers/media/rc/rc-ir-raw.c index 144304c..64ddc3d 100644 --- a/drivers/media/rc/rc-ir-raw.c +++ b/drivers/media/rc/rc-ir-raw.c @@ -274,12 +274,19 @@ int ir_raw_event_register(struct rc_dev *dev) INIT_KFIFO(dev->raw->kfifo); spin_lock_init(&dev->raw->lock); - dev->raw->thread = kthread_run(ir_raw_event_thread, dev->raw, - "rc%u", dev->minor); - if (IS_ERR(dev->raw->thread)) { - rc = PTR_ERR(dev->raw->thread); - goto out; + /* + * raw transmitters do not need any event registration + * because the event is coming from userspace + */ + if (dev->driver_type != RC_DRIVER_IR_RAW_TX) { + dev->raw->thread = kthread_run(ir_raw_event_thread, dev->raw, + "rc%u", dev->minor); + + if (IS_ERR(dev->raw->thread)) { + rc = PTR_ERR(dev->raw->thread); + goto out; + } } mutex_lock(&ir_raw_handler_lock);