From patchwork Fri Sep 28 08:26:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Hu X-Patchwork-Id: 187732 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id CC0C82C00C5 for ; Fri, 28 Sep 2012 18:26:39 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1THVrW-0001ob-Ph; Fri, 28 Sep 2012 08:23:54 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1THVrV-0001oV-LU for fwts-devel@lists.ubuntu.com; Fri, 28 Sep 2012 08:23:53 +0000 Received: from [175.41.48.77] (helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1THVu8-00082B-0X; Fri, 28 Sep 2012 08:26:36 +0000 From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH 1/2] efi_runtime: add checking the efi enviroment Date: Fri, 28 Sep 2012 16:26:30 +0800 Message-Id: <1348820791-4450-1-git-send-email-ivan.hu@canonical.com> X-Mailer: git-send-email 1.7.9.5 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: fwts-devel-bounces@lists.ubuntu.com Errors-To: fwts-devel-bounces@lists.ubuntu.com This driver should be worked on efi enviroment, so efi_runtime_init will check efi_enable to register the driver. Signed-off-by: Ivan Hu --- efi_runtime/efi_runtime.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/efi_runtime/efi_runtime.c b/efi_runtime/efi_runtime.c index 7d99fbc..227a910 100644 --- a/efi_runtime/efi_runtime.c +++ b/efi_runtime/efi_runtime.c @@ -304,6 +304,9 @@ static int __init efi_runtime_init(void) printk(KERN_INFO "EFI_RUNTIME Driver v%s\n", EFI_FWTS_EFI_VERSION); + if (!efi_enabled) + return 0; + ret = misc_register(&efi_runtime_dev); if (ret) { printk(KERN_ERR "efi_runtime: can't misc_register on minor=%d\n", @@ -317,7 +320,9 @@ static int __init efi_runtime_init(void) static void __exit efi_runtime_exit(void) { printk(KERN_INFO "EFI_RUNTIME Driver Exit.\n"); - misc_deregister(&efi_runtime_dev); + if (efi_enabled) + misc_deregister(&efi_runtime_dev); + } module_init(efi_runtime_init);