From patchwork Wed Nov 2 10:40:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Shyti X-Patchwork-Id: 9408913 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 EAE3F60585 for ; Wed, 2 Nov 2016 10:41:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0685228BA6 for ; Wed, 2 Nov 2016 10:41:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED81B2999A; Wed, 2 Nov 2016 10:41:52 +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 8C72128BA6 for ; Wed, 2 Nov 2016 10:41:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755773AbcKBKlh (ORCPT ); Wed, 2 Nov 2016 06:41:37 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:49863 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755580AbcKBKkz (ORCPT ); Wed, 2 Nov 2016 06:40:55 -0400 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 <0OG002068GBPNE00@mailout4.samsung.com>; Wed, 02 Nov 2016 19:40:38 +0900 (KST) X-AuditID: cbfee61b-f793d6d000005a2a-91-5819c2a65ef1 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id FE.55.23082.6A2C9185; Wed, 2 Nov 2016 19:40:38 +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 <0OG0001SHGBL7DA0@mmp1.samsung.com>; Wed, 02 Nov 2016 19:40:37 +0900 (KST) From: Andi Shyti To: Mauro Carvalho Chehab , Sean Young , Rob Herring , Mark Rutland , Richard Purdie , Jacek Anaszewski 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 v3 4/6] [media] rc-ir-raw: do not generate any receiving thread for raw transmitters Date: Wed, 02 Nov 2016 19:40:08 +0900 Message-id: <20161102104010.26959-5-andi.shyti@samsung.com> X-Mailer: git-send-email 2.10.1 In-reply-to: <20161102104010.26959-1-andi.shyti@samsung.com> References: <20161102104010.26959-1-andi.shyti@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprCIsWRmVeSWpSXmKPExsVy+t9jAd1lhyQjDLbN4rDYfuQZq8XiH8+Z LOYfOcdq0Xv1OaPF5V1z2Cy2vlnHaNGzYSurxdLrF5ksVj+rsGjde4TdYveup6wWC59+Z3Hg 8Vgzbw2jx/Uln5g9Nq3qZPNY8sbaY0v/XXaPPfN/sHr0bVnF6PF5k1wAR5SbTUZqYkpqkUJq XnJ+SmZeuq1SaIibroWSQl5ibqqtUoSub0iQkkJZYk4pkGdkgAYcnAPcg5X07RLcMnZtfMBY cJKz4v+Tn6wNjC/Yuxg5OSQETCQezV0OZYtJXLi3nq2LkYtDSGApo8SWuduhnI+MEhP3/mAD qWIT0JRouv0DLCEi8JZR4tD0V4wgCWaBvYwSez/6gNjCAmkSh9YsYwGxWQRUJVYsXA7WzCtg LdF/opcZYp28xIWrp8BqOAVsJP42PgY7Qwio5sD1/ewTGHkXMDKsYpRILUguKE5KzzXKSy3X K07MLS7NS9dLzs/dxAiOkWfSOxgP73I/xCjAwajEw1twWSJCiDWxrLgy9xCjBAezkgjvt32S EUK8KYmVValF+fFFpTmpxYcYTYEOm8gsJZqcD4zfvJJ4QxNzE3NjAwtzS0sTIyVx3sbZz8KF BNITS1KzU1MLUotg+pg4OKUaGJlYxC5anX4b9oX/7/3dn4/YJc4TWnztQRn3jVXffh7mD81h /HHv3WTp1ImzuDIytaT/s0hMSWU20qwLUxLgjD83zTLqxQMWvUR3S2eBFI+PXzY9efa8qEnq 88ngB8+zjzgea5RZechGLN7K0tf7vW5Is+YP6YqvTkqBi98+SXljWvyV52O+uBJLcUaioRZz UXEiAPJFY9WnAgAA 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 --- 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 205ecc6..db3701f 100644 --- a/drivers/media/rc/rc-ir-raw.c +++ b/drivers/media/rc/rc-ir-raw.c @@ -275,12 +275,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);