From patchwork Sun Dec 18 11:11:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Shyti X-Patchwork-Id: 9479265 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 80EA160830 for ; Sun, 18 Dec 2016 11:13:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B1F8284FE for ; Sun, 18 Dec 2016 11:13:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D22228502; Sun, 18 Dec 2016 11:13:37 +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 D99EB284FE for ; Sun, 18 Dec 2016 11:13:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760741AbcLRLL4 (ORCPT ); Sun, 18 Dec 2016 06:11:56 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:58301 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751610AbcLRLLx (ORCPT ); Sun, 18 Dec 2016 06:11:53 -0500 Received: from epcpsbgm2new.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OID0204JOFICV50@mailout1.samsung.com>; Sun, 18 Dec 2016 20:11:46 +0900 (KST) X-AuditID: cbfee61b-f796f6d000004092-fa-58566ef287f8 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 3F.69.16530.2FE66585; Sun, 18 Dec 2016 20:11:46 +0900 (KST) Received: from gangnam.samsung ([10.113.62.47]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OID00KNEOFKB360@mmp1.samsung.com>; Sun, 18 Dec 2016 20:11:46 +0900 (KST) From: Andi Shyti To: Mauro Carvalho Chehab , Sean Young , Rob Herring , Mark Rutland , Richard Purdie , Jacek Anaszewski , Heiner Kallweit Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, Andi Shyti , Andi Shyti Subject: [PATCH v6 4/6] [media] rc-ir-raw: do not generate any receiving thread for raw transmitters Date: Sun, 18 Dec 2016 20:11:36 +0900 Message-id: <20161218111138.12831-5-andi.shyti@samsung.com> X-Mailer: git-send-email 2.11.0 In-reply-to: <20161218111138.12831-1-andi.shyti@samsung.com> References: <20161218111138.12831-1-andi.shyti@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprLIsWRmVeSWpSXmKPExsVy+t9jAd1PeWERBhuv61lsP/KM1WLxj+dM FvOPnGO1WPR+BqtF79XnjBaXd81hs9j6Zh2jRc+GrawWS69fZLJY/azConXvEXaL3bueslos fPqdxYHXY828NYwe15d8YvbYOesuu8emVZ1sHkveWHts6Qfy9sz/werRt2UVo8fnTXIBnFFu NhmpiSmpRQqpecn5KZl56bZKoSFuuhZKCnmJuam2ShG6viFBSgpliTmlQJ6RARpwcA5wD1bS t0twyzh3fC9zwR/Oii2nrjI2ME7j6GLk5JAQMJHYd3g1I4QtJnHh3nq2LkYuDiGBpYwSj+c+ ZgdJCAl8ZJRYutcHxGYT0JRouv0DrEhEYDqTxNcvB1hAEswCexkl9n4EKxIWSJO48rEfrJlF QFViy+IbYDW8AtYSE/4sZIPYJi+xq+0iK4jNKWAjcWnSPRaIZdYSM5rPsk5g5F3AyLCKUSK1 ILmgOCk91ygvtVyvODG3uDQvXS85P3cTIzhqnknvYDy8y/0QowAHoxIPL8Oa0Agh1sSy4src Q4wSHMxKIrwTs8IihHhTEiurUovy44tKc1KLDzGaAh02kVlKNDkfGNF5JfGGJuYm5sYGFuaW liZGSuK8jbOfhQsJpCeWpGanphakFsH0MXFwSjUwdjg4Wt+2bVkTbqh2vcMiYsP+h1s/5Kq1 s1zPuPaN8eCy46u2cEncXbpox+3t1UenGW4XnPnu0q5Jpb+DPJ22LSxuuqv/atnyZ4fjMjLf RkVeeTPNZPrlfUc99vw3Cyxv3ZTSbnJ3+4sPi7eJ3zjT1eiQGp+6+feUbF/xNne7tyVCme9t VDuuqiqxFGckGmoxFxUnAgCd/1WMsAIAAA== X-MTR: 20000000000000000@CPGS 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 Reviewed-by: Sean Young --- 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 1c42a9f2f290..9938e42e0c0b 100644 --- a/drivers/media/rc/rc-ir-raw.c +++ b/drivers/media/rc/rc-ir-raw.c @@ -270,12 +270,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);