From patchwork Tue Mar 18 17:01:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 874526 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5B5F01C84B3; Tue, 18 Mar 2025 17:02:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742317357; cv=none; b=j9L8zbRgFhWZHnu9b7JMPeQnpSFnM2easckT0e4lXqO/tL0pmrapU7pMYeup3Q8ppHLLI6dJDvMm9ydq0E4JwPmTk+BgxqIVcLMpR59ey+T7IvFrQNhknncNw5ABciseay524TwbeVty214s1/VeNLYRD0RSDoQx5hCAJ/NbU08= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742317357; c=relaxed/simple; bh=NxGa/BYNzmW9bOjmp9UiIR5gFv8/hjmQZjBr2tY5hTo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=k7ukxEhHg/NWkfec0zd6q8V+355N2wikENEY7iZe6rYtS5n7jWM/P27jz4FCSOxcr19B9UaAIV5ZtBzeu1NOLEqC9qiGaXy0zLuCDns+6E25ZosjxhxzekgKYeVGhvtwOZalK3w9bPHml9cr30cx8Fx2SxYQYTmcmmGs7Vs+FwI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 306561BB2; Tue, 18 Mar 2025 10:02:44 -0700 (PDT) Received: from e133711.arm.com (e133711.arm.com [10.1.196.55]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8CAF43F673; Tue, 18 Mar 2025 10:02:34 -0700 (PDT) From: Sudeep Holla Date: Tue, 18 Mar 2025 17:01:42 +0000 Subject: [PATCH v2 4/8] rtc: efi: Transition to the faux device interface Precedence: bulk X-Mailing-List: linux-efi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250318-plat2faux_dev-v2-4-e6cc73f78478@arm.com> References: <20250318-plat2faux_dev-v2-0-e6cc73f78478@arm.com> In-Reply-To: <20250318-plat2faux_dev-v2-0-e6cc73f78478@arm.com> To: linux-kernel@vger.kernel.org Cc: Sudeep Holla , Greg Kroah-Hartman , Ard Biesheuvel , Alexandre Belloni , linux-rtc@vger.kernel.org, linux-efi@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3019; i=sudeep.holla@arm.com; h=from:subject:message-id; bh=NxGa/BYNzmW9bOjmp9UiIR5gFv8/hjmQZjBr2tY5hTo=; b=owEBbQKS/ZANAwAIAQBBurwxfuKYAcsmYgBn2aciebbTzQhRmgg/xlGI0w8PqOp31fwsjXo+Z VYP7+JPVHyJAjMEAAEIAB0WIQS6ceUSBvMeskPdk+EAQbq8MX7imAUCZ9mnIgAKCRAAQbq8MX7i mOhaD/9vLdO8FgtbCKPTY7or2IRU0owZ2m7r3H583ZV3uKqgaoK41ui4StiX0NpkkGINjAItgd/ UxRr9EbKLD30OIo+8FFRZ6Dhg48nYj8mkxleLPhnbqMW1yVmlLKhb5S+JjV9ynqETuk/USSPeoQ xRh5fJiIHH4O/E64SkLxwR+UGC45sy9w9MT6lh7o52d6vq5Nbu6agZkjpyOHrdSfThMrtBmpOPJ d2ExuvwvXSvFYs6LG03vRra/RF5RtpFBn8oXChDSNE6W9w9eCMxdAxIUo0wJUsWk99mfC4plJvA CI4b1a7SQM95Jn+0ANbRGas3eXOSU7/O/3i82sepeKHh1UaC4RQJ8RUFAe/Jr3eKK1WaexSLy+5 dx6SbEazaAAwRis+75ZOrLrXFPVsYs0/j8NDAPMXZjm/kvxnlyxH/yj2Lbvr+yqjkuUqB0IGLKF +IW9mo1UNVPJgF58xl8ZcuGg/VptP353q3pnt6X5d+0gAMo6BKDPmXEmL9UYqBNg9DydhBaoCL3 zRALszABPuyUwkRvpwNS1NnHdmlv/XOBbRvVzHlm8dqT9/j0/E3I6B642oGQ5DoJ3rZwWfRNod8 9B0PoHX9I82VLmog4AnH8ERM8xrRNC31TJj171k4Mn0x3yTJBEGA5UuTDVPOa9p0GZmWqfG7UIE vHTr43UocxIsIMg== X-Developer-Key: i=sudeep.holla@arm.com; a=openpgp; fpr=7360A21742ADF5A11767C1C139CFD4755FE2D5B4 The EFI RTC driver does not require the creation of a platform device. Originally, this approach was chosen for simplicity when the driver was first implemented. With the introduction of the lightweight faux device interface, we now have a more appropriate alternative. Migrate the driver to utilize the faux bus, given that the platform device it previously created was not a real one anyway. This will simplify the code, reducing its footprint while maintaining functionality. Cc: Ard Biesheuvel Cc: Alexandre Belloni Cc: linux-rtc@vger.kernel.org Cc: linux-efi@vger.kernel.org Signed-off-by: Sudeep Holla --- drivers/firmware/efi/efi.c | 3 --- drivers/rtc/rtc-efi.c | 16 +++++----------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index 7309394b8fc98cf7a3424af209b752f0251c8c89..8aebc747c65bc1b63d514a50fe6f35a9e3c1af0a 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -427,9 +427,6 @@ static int __init efisubsys_init(void) } } - if (efi_rt_services_supported(EFI_RT_SUPPORTED_TIME_SERVICES)) - platform_device_register_simple("rtc-efi", 0, NULL, 0); - /* We register the efi directory at /sys/firmware/efi */ efi_kobj = kobject_create_and_add("efi", firmware_kobj); if (!efi_kobj) { diff --git a/drivers/rtc/rtc-efi.c b/drivers/rtc/rtc-efi.c index fa8bf82df9488e7d1c23c058b4a3032dde74bc6e..681d917d541e51b37f2d59b0567caf6aa8bf05f4 100644 --- a/drivers/rtc/rtc-efi.c +++ b/drivers/rtc/rtc-efi.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include @@ -254,7 +254,7 @@ static const struct rtc_class_ops efi_rtc_ops = { .proc = efi_procfs, }; -static int __init efi_rtc_probe(struct platform_device *dev) +static int __init efi_rtc_probe(struct faux_device *dev) { struct rtc_device *rtc; efi_time_t eft; @@ -268,7 +268,7 @@ static int __init efi_rtc_probe(struct platform_device *dev) if (IS_ERR(rtc)) return PTR_ERR(rtc); - platform_set_drvdata(dev, rtc); + faux_device_set_drvdata(dev, rtc); rtc->ops = &efi_rtc_ops; clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc->features); @@ -282,15 +282,9 @@ static int __init efi_rtc_probe(struct platform_device *dev) return devm_rtc_register_device(rtc); } -static struct platform_driver efi_rtc_driver = { - .driver = { - .name = "rtc-efi", - }, -}; - -module_platform_driver_probe(efi_rtc_driver, efi_rtc_probe); +module_faux_driver(rtc_efi, efi_rtc_probe, NULL, + efi_rt_services_supported(EFI_RT_SUPPORTED_TIME_SERVICES)); MODULE_AUTHOR("dann frazier "); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("EFI RTC driver"); -MODULE_ALIAS("platform:rtc-efi"); From patchwork Tue Mar 18 17:01:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 875533 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1494120FA85; Tue, 18 Mar 2025 17:02:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742317359; cv=none; b=Mq9v7PYxiGNId447+e8IYwEUharR2kivyBIocZUDix+29wWdS8GzPC/UMtoUJCzcMcQgJau+ml1HdEM8nn10VGAEuEm6rwEf2SHjcMBgsVH1guhi9QyLy2dgAlZwR2IWd5Br1X4DYD/Nzt4J4Tan+sMEhhuTGbOHbzLA/R7accE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742317359; c=relaxed/simple; bh=k6j3DBsimegxPoU9UiZ9TSkg2hg0aryPCM5hJl5zw4g=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qm5mbT+mb2dAzUqdTXTNJjIpFVjAaQez5AWQ2CSlOWcFLdWXiBXRmzrrl6ewnav1A5zcJhkAFL1NRrcDLOUcOLqGTxtULGsJv7dYPq+wmWmEM+4Xur1/oladNseZK08VKnh/T2n28dMD0DtiSp3SKYxiHNkUEBpKjUCMFFqPak8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5A8001BF7; Tue, 18 Mar 2025 10:02:45 -0700 (PDT) Received: from e133711.arm.com (e133711.arm.com [10.1.196.55]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0A2A53F673; Tue, 18 Mar 2025 10:02:35 -0700 (PDT) From: Sudeep Holla Date: Tue, 18 Mar 2025 17:01:43 +0000 Subject: [PATCH v2 5/8] virt: efi_secret: Transition to the faux device interface Precedence: bulk X-Mailing-List: linux-efi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250318-plat2faux_dev-v2-5-e6cc73f78478@arm.com> References: <20250318-plat2faux_dev-v2-0-e6cc73f78478@arm.com> In-Reply-To: <20250318-plat2faux_dev-v2-0-e6cc73f78478@arm.com> To: linux-kernel@vger.kernel.org Cc: Sudeep Holla , Greg Kroah-Hartman , Ard Biesheuvel , linux-efi@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4350; i=sudeep.holla@arm.com; h=from:subject:message-id; bh=k6j3DBsimegxPoU9UiZ9TSkg2hg0aryPCM5hJl5zw4g=; b=owEBbQKS/ZANAwAIAQBBurwxfuKYAcsmYgBn2aciefH/zbE9cqyOtTLIfCPlafuR7jl/RVr/f rkxbVS6LgOJAjMEAAEIAB0WIQS6ceUSBvMeskPdk+EAQbq8MX7imAUCZ9mnIgAKCRAAQbq8MX7i mJO4D/4wgOELwUSW3aUd98WcEmrln+VhUVv4IND46FmOMaLpLzOPpA4zIA0yrVUMS+iJO8HVy92 nh4r27qvdgXBNORd3jej4FswWHuPHBV07OZrwVCEGDUQVPevirLb1FeT23ZSkCxchWsuWMgKtt9 +GXgXqzI1RhXTyTmw3DRmzbWeSzjnrANxekYJOx1u8Qitn6DMSoYDktuaGiVH50kp4trjhQZo9k TQrAZQsEh30lk+18+uzjivnlpBeJgUN8CG/9m3f0OR9BHSoZbY9EWp0YhkfGmnVxFX10UvQacMq r0oDVhQIZ1xtKZja3tY2jO6omSIH3CxridohV7EMgjDJ3/pFjCN9KYdqeQrI7/+GJnk6eAEygUM wpunQDRO2iyjGmFUGuBj4JV5DN4+IVY5bXdAXQhdpFpxV8RG6N/OA4TxnmoMOABOCcd707gbtUi lm7Mw4e8CH1OZtdn/5Pb4rXUjykcNNtdirM/KKREGJmuT0j69LDcc8x2npo2TSh6HtQkm+W3LPQ 2Z8zQo8BQN6DnFqJcu/7BDLeflK9Rg1yX2kqFRdKhgFZ5uEn7jICyTP5616vTZaORzucJsEtkQN zirUeRcMCC/B6+sJTmbhkq5l5AvQGOPB96Ldy93CcYriykU2xId03YvkziUD0BE+h67Z0B5p/2U 1efnVjM+GiVDahg== X-Developer-Key: i=sudeep.holla@arm.com; a=openpgp; fpr=7360A21742ADF5A11767C1C139CFD4755FE2D5B4 The EFI secret area driver does not require the creation of a platform device. Originally, this approach was chosen for simplicity when the driver was first implemented. With the introduction of the lightweight faux device interface, we now have a more appropriate alternative. Migrate the driver to utilize the faux bus, given that the platform device it previously created was not a real one anyway. This will simplify the code, reducing its footprint while maintaining functionality. Cc: Ard Biesheuvel Cc: linux-efi@vger.kernel.org Signed-off-by: Sudeep Holla --- drivers/firmware/efi/efi.c | 5 ----- drivers/virt/coco/efi_secret/efi_secret.c | 29 ++++++++--------------------- 2 files changed, 8 insertions(+), 26 deletions(-) diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index 8aebc747c65bc1b63d514a50fe6f35a9e3c1af0a..862b7744c28ecc9e5a64bbb3533c34119f50267f 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -465,11 +465,6 @@ static int __init efisubsys_init(void) if (efi_enabled(EFI_DBG) && efi_enabled(EFI_PRESERVE_BS_REGIONS)) efi_debugfs_init(); -#ifdef CONFIG_EFI_COCO_SECRET - if (efi.coco_secret != EFI_INVALID_TABLE_ADDR) - platform_device_register_simple("efi_secret", 0, NULL, 0); -#endif - return 0; err_remove_group: diff --git a/drivers/virt/coco/efi_secret/efi_secret.c b/drivers/virt/coco/efi_secret/efi_secret.c index 1864f9f80617e082feb574a15327949972c8cc1e..a60976750bef787c78401bf4569ee5d0c7d2b5f4 100644 --- a/drivers/virt/coco/efi_secret/efi_secret.c +++ b/drivers/virt/coco/efi_secret/efi_secret.c @@ -16,7 +16,7 @@ * is the GUID of the secret entry, and its content is the secret data. */ -#include +#include #include #include #include @@ -152,17 +152,12 @@ static const struct inode_operations efi_secret_dir_inode_operations = { .unlink = efi_secret_unlink, }; -static int efi_secret_map_area(struct platform_device *dev) +static int efi_secret_map_area(struct faux_device *dev) { int ret; struct efi_secret *s = efi_secret_get(); struct linux_efi_coco_secret_area *secret_area; - if (efi.coco_secret == EFI_INVALID_TABLE_ADDR) { - dev_err(&dev->dev, "Secret area address is not available\n"); - return -EINVAL; - } - secret_area = memremap(efi.coco_secret, sizeof(*secret_area), MEMREMAP_WB); if (secret_area == NULL) { dev_err(&dev->dev, "Could not map secret area EFI config entry\n"); @@ -191,7 +186,7 @@ static int efi_secret_map_area(struct platform_device *dev) return ret; } -static void efi_secret_securityfs_teardown(struct platform_device *dev) +static void efi_secret_securityfs_teardown(struct faux_device *dev) { struct efi_secret *s = efi_secret_get(); int i; @@ -210,7 +205,7 @@ static void efi_secret_securityfs_teardown(struct platform_device *dev) dev_dbg(&dev->dev, "Removed securityfs entries\n"); } -static int efi_secret_securityfs_setup(struct platform_device *dev) +static int efi_secret_securityfs_setup(struct faux_device *dev) { struct efi_secret *s = efi_secret_get(); int ret = 0, i = 0, bytes_left; @@ -307,7 +302,7 @@ static void efi_secret_unmap_area(void) } } -static int efi_secret_probe(struct platform_device *dev) +static int efi_secret_probe(struct faux_device *dev) { int ret; @@ -326,23 +321,15 @@ static int efi_secret_probe(struct platform_device *dev) return ret; } -static void efi_secret_remove(struct platform_device *dev) +static void efi_secret_remove(struct faux_device *dev) { efi_secret_securityfs_teardown(dev); efi_secret_unmap_area(); } -static struct platform_driver efi_secret_driver = { - .probe = efi_secret_probe, - .remove = efi_secret_remove, - .driver = { - .name = "efi_secret", - }, -}; - -module_platform_driver(efi_secret_driver); +module_faux_driver(efi_secret, efi_secret_probe, efi_secret_remove, + efi.coco_secret != EFI_INVALID_TABLE_ADDR); MODULE_DESCRIPTION("Confidential computing EFI secret area access"); MODULE_AUTHOR("IBM"); MODULE_LICENSE("GPL"); -MODULE_ALIAS("platform:efi_secret"); From patchwork Tue Mar 18 17:01:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 874525 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4691F212D7B; Tue, 18 Mar 2025 17:02:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742317359; cv=none; b=u8UmCeQwgnf2uuKFQhtmTu5KS5fDkxYGYnoklYskW+DXfxPHHqcr+fvslecUgkRyHk4HQVVagSIbm9x87m2r1BR8wuBGoC/VtrfJniLclZsMpfhIih3UEyC3xeRT/PKLbE7g2aMOZ+bitHTD3KfUGvHGpS012wLTw2Vh153RtAQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742317359; c=relaxed/simple; bh=gRkb6p8XPCkCChpfA0g/BMq90thBf9o9KpCxbQ5q/L4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iKHVaiDARdkEp+DSvD5/xMP1wMBbGY09y/pAc6MU/VxyzDPNMgIE9w89yp8OrSw9aXEZ2vonhYRu6OfqlHeysdRstLdbdGq56ygb/JaQ1WazBrqz5TJN0QewuggnzesTwzWcKP5oc/HsSXr0jK+GXWuyrOL8xN4hpvZx6QJNC+E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 84742152B; Tue, 18 Mar 2025 10:02:46 -0700 (PDT) Received: from e133711.arm.com (e133711.arm.com [10.1.196.55]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3446E3F673; Tue, 18 Mar 2025 10:02:37 -0700 (PDT) From: Sudeep Holla Date: Tue, 18 Mar 2025 17:01:44 +0000 Subject: [PATCH v2 6/8] efi: efivars: Transition to the faux device interface Precedence: bulk X-Mailing-List: linux-efi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250318-plat2faux_dev-v2-6-e6cc73f78478@arm.com> References: <20250318-plat2faux_dev-v2-0-e6cc73f78478@arm.com> In-Reply-To: <20250318-plat2faux_dev-v2-0-e6cc73f78478@arm.com> To: linux-kernel@vger.kernel.org Cc: Sudeep Holla , Greg Kroah-Hartman , Ard Biesheuvel , linux-efi@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2136; i=sudeep.holla@arm.com; h=from:subject:message-id; bh=gRkb6p8XPCkCChpfA0g/BMq90thBf9o9KpCxbQ5q/L4=; b=owEBbQKS/ZANAwAIAQBBurwxfuKYAcsmYgBn2aciI9VxHIej0aKWzdG0ZStyVb+NQKRpF5n/Q ttdDeVqi9WJAjMEAAEIAB0WIQS6ceUSBvMeskPdk+EAQbq8MX7imAUCZ9mnIgAKCRAAQbq8MX7i mIi6D/9h6GsGE8BacOX3uMQGEHySIAN9eHGjqgy+PGAtv4oy2OaTmZYwQS4j1bFA+C5x3wYbQdj VLXS+P/54M8C29XsUOcqyBLy4pZU4CDZKCEw+f8yTeYpLYEcrTE3OfIEi9VrYYXa3QB8p8FSqEI nPz7gI+OsFaHWh9QxBo7m3s6Jnw0Xp4K556IJZpUJ6C78zEHOswBNuL2LuPKkgSdP3GMsp3T5GF B0vVne8Un8M98XCs7QKV+1zq+j4pfVioHIuFVlMObV/RmAJeEqzCu3r3UNm2zgYLn1DDODXARvz j2z3TkNkqE73eSYn8E6O7Pqv2Dzr6SKsir7u6YRBPmXeAy08Mq6jmUunENoxrQwAxR/ZgJd2T3z D0ctTht3d/OyWUI240P807NzA/4ywnmfIJ8cWw1Tlt2e9vZyC9gccsjHTf7iFY2gbI0jGLR0aLz jRf+NC/cPnMBgWkyht/aFLO7PcDoATGoTihU/0WORFUK5FwMXQa9LDERwvcX3YfmROa707easdh jAENC68BaBnUipuIfod6Sqzj6Bdnvel9tMM7noqXMTCSlWct+YmtgyviyC/mm9KcH+E5Zk4iOWC GZ0NJne3WB4m0mySGYC800zg9lfVLmTxI66HaJqVwZ7H1Hm5Ood/bGsScLZ3MmEzq7KSfhxczkg WcsZDBwA21e70ww== X-Developer-Key: i=sudeep.holla@arm.com; a=openpgp; fpr=7360A21742ADF5A11767C1C139CFD4755FE2D5B4 The "efivars" platform device is created just to enable the efi-pstore module to autoload based on it. It doesn't have to be platform device though. Originally, this approach was chosen for simplicity when the driver was first implemented. With the introduction of the lightweight faux device interface, we now have a more appropriate alternative. Migrate this efivars device to utilize the faux bus, given that the platform device it previously created was not a real one anyway. The modalias is retained here as efi-pstore module is dependent on it. Cc: Ard Biesheuvel Cc: linux-efi@vger.kernel.org Signed-off-by: Sudeep Holla --- drivers/firmware/efi/efi-pstore.c | 2 +- drivers/firmware/efi/efi.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/firmware/efi/efi-pstore.c b/drivers/firmware/efi/efi-pstore.c index a253b61449459eca31afc6ca780a20c4557659ba..eed756a59bba3b5a58cd2e238400c3c12fd5edd5 100644 --- a/drivers/firmware/efi/efi-pstore.c +++ b/drivers/firmware/efi/efi-pstore.c @@ -301,4 +301,4 @@ module_exit(efivars_pstore_exit); MODULE_DESCRIPTION("EFI variable backend for pstore"); MODULE_LICENSE("GPL"); -MODULE_ALIAS("platform:efivars"); +MODULE_ALIAS("faux:efivars"); diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index 862b7744c28ecc9e5a64bbb3533c34119f50267f..dc5c24a7ca540cac342ceddcdbf75b55bf82c889 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include @@ -443,7 +443,7 @@ static int __init efisubsys_init(void) error = efivar_ssdt_load(); if (error) pr_err("efi: failed to load SSDT, error %d.\n", error); - platform_device_register_simple("efivars", 0, NULL, 0); + faux_device_create("efivars", NULL, NULL); } BLOCKING_INIT_NOTIFIER_HEAD(&efivar_ops_nh);