From patchwork Thu Sep 1 17:16:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Shyti X-Patchwork-Id: 9309737 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 E4D8B60760 for ; Thu, 1 Sep 2016 21:29:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA8062951E for ; Thu, 1 Sep 2016 21:29:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9EF832954A; Thu, 1 Sep 2016 21:29:08 +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 428D82951E for ; Thu, 1 Sep 2016 21:29:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757319AbcIAV1Y (ORCPT ); Thu, 1 Sep 2016 17:27:24 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:46549 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753580AbcIAV1U (ORCPT ); Thu, 1 Sep 2016 17:27:20 -0400 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OCU00EKR5BQFJ00@mailout1.samsung.com>; Fri, 02 Sep 2016 02:16:38 +0900 (KST) Received: from epcpsbgm2new.samsung.com ( [172.20.52.113]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id D1.02.31386.67268C75; Fri, 2 Sep 2016 02:16:38 +0900 (KST) X-AuditID: cbfee68d-f79286d000007a9a-62-57c86276b815 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 4E.F4.07740.57268C75; Thu, 1 Sep 2016 10:16:38 -0700 (MST) 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 <0OCU00L0B5BMT280@mmp1.samsung.com>; Fri, 02 Sep 2016 02:16:37 +0900 (KST) From: Andi Shyti To: Mauro Carvalho Chehab , Sean Young , Rob Herring , Mark Rutland Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Andi Shyti , Andi Shyti Subject: [PATCH v2 4/7] [media] rc-ir-raw: do not generate any receiving thread for raw transmitters Date: Fri, 02 Sep 2016 02:16:26 +0900 Message-id: <20160901171629.15422-5-andi.shyti@samsung.com> X-Mailer: git-send-email 2.9.3 In-reply-to: <20160901171629.15422-1-andi.shyti@samsung.com> References: <20160901171629.15422-1-andi.shyti@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrHLMWRmVeSWpSXmKPExsWyRsSkULcs6US4wbyzHBbbjzxjtVj84zmT xfwj51gtLu+aw2bRs2Erq8XS6xeZLFY/q7Bo3XuE3WLh0+8sDpwea+atYfS4vuQTs8emVZ1s HkveWHts6b/L7tG3ZRWjx+dNcgHsUVw2Kak5mWWpRfp2CVwZ+x5KFpzgrLh++StzA+Nz9i5G Tg4JAROJac+2MEPYYhIX7q1n62Lk4hASWMEoseLcGkaYoiMXPjNBJJYySjTOmARV9ZFRYu31 h2wgVWwCmhJNt3+AJUQEZjFKvJ76A2wus8BCRokNn5VBbGGBNIm7B46CxVkEVCVOzJ3FBGLz ClhLHJl2gQ1inZzEpW1fwGo4BWwkJp++zApiCwHVH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kaWRuaGFkbG5 kjjv4//rwoQE0hNLUrNTUwtSi2D6mDg4pRoYs96o77tRU63EPiPyZpzek38fPovIPPn7XTpm /ZfzatYdC0ziU6MOi2oUav1or0lUZWO9qqwinm+95oWoupjbv8KwVYl7A3Pe9rU9imy56uje eUsxdmun4OwJFQ3bmJcyvGF6F1A6r+W3yB6jhX/ntv9JWPRx25wFrxd7fv54Q2dFziqtM0vm KrEUZyQaajEXFScCAFUN7ADOAgAA 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);