From patchwork Wed Dec 14 14:00:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Shyti X-Patchwork-Id: 9474209 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 CBD8D60571 for ; Wed, 14 Dec 2016 14:02:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BEB93286F8 for ; Wed, 14 Dec 2016 14:02:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B385B28710; Wed, 14 Dec 2016 14:02:06 +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 5C7D0286F8 for ; Wed, 14 Dec 2016 14:02:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752849AbcLNOBr (ORCPT ); Wed, 14 Dec 2016 09:01:47 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:44279 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756039AbcLNOA7 (ORCPT ); Wed, 14 Dec 2016 09:00:59 -0500 Received: from epcpsbgm2new.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OI601QEOHKY4SE0@mailout4.samsung.com>; Wed, 14 Dec 2016 23:00:44 +0900 (KST) X-AuditID: cbfee61b-f796f6d000004092-2b-5851508cb496 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 5E.F7.16530.C8051585; Wed, 14 Dec 2016 23:00:44 +0900 (KST) Received: from gangnam.samsung ([10.113.62.47]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OI60001AHL56DC0@mmp2.samsung.com>; Wed, 14 Dec 2016 23:00:44 +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 v4 4/6] [media] rc-ir-raw: do not generate any receiving thread for raw transmitters Date: Wed, 14 Dec 2016 23:00:28 +0900 Message-id: <20161214140030.28537-5-andi.shyti@samsung.com> X-Mailer: git-send-email 2.10.2 In-reply-to: <20161214140030.28537-1-andi.shyti@samsung.com> References: <20161214140030.28537-1-andi.shyti@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprHIsWRmVeSWpSXmKPExsVy+t9jQd2egMAIg+8r9Cy2H3nGarH4x3Mm i/lHzrFaLHo/g9Wi9+pzRovLu+awWWx9s47RomfDVlaLpdcvMlmsflZh0br3CLvF7l1PWS0W Pv3O4sDrsWbeGkaP60s+MXvsnHWX3WPTqk42jyVvrD229AN5e+b/YPXo27KK0ePzJrkAzig3 m4zUxJTUIoXUvOT8lMy8dFul0BA3XQslhbzE3FRbpQhd35AgJYWyxJxSIM/IAA04OAe4Byvp 2yW4ZTQ9W8Ze8ImzYvfERSwNjD0cXYycHBICJhKfWp+wQthiEhfurWfrYuTiEBKYxShx4ukk KOcjo8SOxWdYQKrYBDQlmm7/AEuICExnkvj65QBYgllgL6PE3o8+ILawQJrE3MVrmUFsFgFV ictXHjOB2LwC1hKts7+wQayTl1h4/ghYnFPARmJP1zMwWwio5vn2mcwTGHkXMDKsYpRILUgu KE5KzzXKSy3XK07MLS7NS9dLzs/dxAiOm2fSOxgP73I/xCjAwajEw5sAjCch1sSy4srcQ4wS HMxKIrxTfIFCvCmJlVWpRfnxRaU5qcWHGE2BDpvILCWanA+M6bySeEMTcxNzYwMLc0tLEyMl cd7G2c/ChQTSE0tSs1NTC1KLYPqYODilGhgNpk8snO56+ojtpIAk5TNLpBtPXAlokWBpy5wS IJW/x2zuQk+PCCMTvS/fz4UYXppl/vjH0ZdfRcKkeDQT8pZJ3Nq6c0OqfdvLSrmZUrsO/Pz6 MbDo7JrlIjHM2Qmbyib/+GC4aV/Pg+1J//UbH8V+fueSaK7IkKkVc6DU/8My/7T6a5H65luV WIozEg21mIuKEwFukePNsQIAAA== 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 1c42a9f..9938e42 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);