From patchwork Sat Nov 21 14:55:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 7674531 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 16EE79F2EC for ; Sat, 21 Nov 2015 15:32:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2A4E020654 for ; Sat, 21 Nov 2015 15:32:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2C4F020650 for ; Sat, 21 Nov 2015 15:32:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760850AbbKUPcg (ORCPT ); Sat, 21 Nov 2015 10:32:36 -0500 Received: from mail-wm0-f49.google.com ([74.125.82.49]:37240 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760545AbbKUPcg (ORCPT ); Sat, 21 Nov 2015 10:32:36 -0500 Received: by wmww144 with SMTP id w144so55015413wmw.0 for ; Sat, 21 Nov 2015 07:32:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-type:content-transfer-encoding; bh=DtZI0X2UQbY4k0hewyUxgeqTqIDwIZfDV8lPQ0tojHE=; b=kGmDZ2vTQPrydiPOUOzNANPx5p6uyxMEzBxT2bIHzuI5DHiZhN7wGlV5DV6MN+8hIr olU/1cP9TscZMWTvrBJid6wLRkQTPAyorg3APp3dv55+n9WzFIL5WXOQ93AqEBeaqwT7 bdi7fmFphTcDtZ/v6dG+ufbUSbTvQqCbc5TgKgwhYQhz4s7hhKvGs17SblKFo2iw9cs4 +7SFNhgM1KJzFxIzZLTLIvekUzbmk/ie2DBsrdIswXohWOPFnH3aHrazQ7QN0F0Z3jCD MKp93idzzuh34mJRUCPR4yQuvM2D7ee4HDFFw5HwFS1pQ8AmccziiGJS+weqSpp5AzQ/ 2VFA== X-Received: by 10.28.96.4 with SMTP id u4mr9520194wmb.52.1448119954737; Sat, 21 Nov 2015 07:32:34 -0800 (PST) Received: from ?IPv6:2003:62:5f55:ba00:681b:1517:83c2:9e4a? (p200300625F55BA00681B151783C29E4A.dip0.t-ipconnect.de. [2003:62:5f55:ba00:681b:1517:83c2:9e4a]) by smtp.googlemail.com with ESMTPSA id h7sm4670999wjz.7.2015.11.21.07.32.33 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 21 Nov 2015 07:32:34 -0800 (PST) To: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org From: Heiner Kallweit Subject: [PATCH 1/2] media: rc: remove unneeded code Message-ID: <565085C7.2020208@gmail.com> Date: Sat, 21 Nov 2015 15:55:03 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Now that that the decoder modules are loaded on-demand we can move loading the lirc module to rc_register_device directly and remove unneeded functions and comments. Signed-off-by: Heiner Kallweit --- drivers/media/rc/rc-core-priv.h | 7 ------- drivers/media/rc/rc-ir-raw.c | 10 ---------- drivers/media/rc/rc-main.c | 4 +--- 3 files changed, 1 insertion(+), 20 deletions(-) diff --git a/drivers/media/rc/rc-core-priv.h b/drivers/media/rc/rc-core-priv.h index 071651a..7359f3d 100644 --- a/drivers/media/rc/rc-core-priv.h +++ b/drivers/media/rc/rc-core-priv.h @@ -167,11 +167,4 @@ void ir_raw_init(void); * loads the compiled decoders for their usage with IR raw events */ -/* from ir-lirc-codec.c */ -#ifdef CONFIG_IR_LIRC_CODEC_MODULE -#define load_lirc_codec() request_module_nowait("ir-lirc-codec") -#else -static inline void load_lirc_codec(void) { } -#endif - #endif /* _RC_CORE_PRIV */ diff --git a/drivers/media/rc/rc-ir-raw.c b/drivers/media/rc/rc-ir-raw.c index c6433e8..c69807f 100644 --- a/drivers/media/rc/rc-ir-raw.c +++ b/drivers/media/rc/rc-ir-raw.c @@ -360,13 +360,3 @@ void ir_raw_handler_unregister(struct ir_raw_handler *ir_raw_handler) mutex_unlock(&ir_raw_handler_lock); } EXPORT_SYMBOL(ir_raw_handler_unregister); - -void ir_raw_init(void) -{ - /* Load the decoder modules */ - load_lirc_codec(); - - /* If needed, we may later add some init code. In this case, - it is needed to change the CONFIG_MODULE test at rc-core.h - */ -} diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c index 9d05d03..1042fa3 100644 --- a/drivers/media/rc/rc-main.c +++ b/drivers/media/rc/rc-main.c @@ -1471,10 +1471,8 @@ int rc_register_device(struct rc_dev *dev) kfree(path); if (dev->driver_type == RC_DRIVER_IR_RAW) { - /* Load raw decoders, if they aren't already */ if (!raw_init) { - IR_dprintk(1, "Loading raw decoders\n"); - ir_raw_init(); + request_module_nowait("ir-lirc-codec"); raw_init = true; } /* calls ir_register_device so unlock mutex here*/