From patchwork Tue Oct 2 09:34:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Hu X-Patchwork-Id: 188435 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 7FCF12C00AB for ; Tue, 2 Oct 2012 19:34:43 +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 1TIysD-0004vF-QR; Tue, 02 Oct 2012 09:34:41 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TIysB-0004v8-EW for fwts-devel@lists.ubuntu.com; Tue, 02 Oct 2012 09:34:39 +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 1TIysA-0007By-SH; Tue, 02 Oct 2012 09:34:39 +0000 From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [1/2 v3][PATCH] efi_runtime: add checking the efi environment Date: Tue, 2 Oct 2012 17:34:34 +0800 Message-Id: <1349170474-18736-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 environment, so efi_runtime_init will check efi_enable to register the driver. Signed-off-by: Ivan Hu Acked-by: Colin Ian King Acked-by: Keng-Yu Lin --- efi_runtime/efi_runtime.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/efi_runtime/efi_runtime.c b/efi_runtime/efi_runtime.c index 7d99fbc..ccf4eff 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 -ENODEV; + ret = misc_register(&efi_runtime_dev); if (ret) { printk(KERN_ERR "efi_runtime: can't misc_register on minor=%d\n",