From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752822AbaHLGNS (ORCPT ); Tue, 12 Aug 2014 02:13:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60657 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752664AbaHLGNP (ORCPT ); Tue, 12 Aug 2014 02:13:15 -0400 From: Dave Young To: Matt Fleming Cc: Catalin Marinas , Will Deacon , Thomas Gleixner , Ingo Molnar , hpa@zytor.com, Alessandro Zummo , Leif Lindholm , Ard Biesheuvel , Mark Salter , Randy Dunlap , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org, rtc-linux@googlegroups.com Subject: [PATCH 5/5] efi_rtc: probe function error out in case no efi runtime enabled Date: Tue, 12 Aug 2014 14:10:22 +0800 Message-Id: <1407823822-23829-5-git-send-email-dyoung@redhat.com> In-Reply-To: <1407823822-23829-1-git-send-email-dyoung@redhat.com> References: <1407823822-23829-1-git-send-email-dyoung@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org efi rtc depends on efi runtime services, so if efi runtime services are not usable it should error out. Without this patch rtc-efi will panic with 'noefi' boot Signed-off-by: Dave Young --- drivers/rtc/rtc-efi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/rtc/rtc-efi.c b/drivers/rtc/rtc-efi.c index 8225b89..8c02ed8 100644 --- a/drivers/rtc/rtc-efi.c +++ b/drivers/rtc/rtc-efi.c @@ -213,6 +213,9 @@ static int __init efi_rtc_probe(struct platform_device *dev) { struct rtc_device *rtc; + if (!efi_enabled(EFI_RUNTIME_SERVICES)) + return -ENODEV; + rtc = devm_rtc_device_register(&dev->dev, "rtc-efi", &efi_rtc_ops, THIS_MODULE); if (IS_ERR(rtc)) -- 1.8.3.1