Skip to content

Commit 01fce21

Browse files
committed
Merge tag 'x86_microcode_for_v6.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 microcode loader update from Borislav Petkov: - Switch the microcode loader from using the fake platform device to the new simple faux bus * tag 'x86_microcode_for_v6.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/microcode: Move away from using a fake platform device
2 parents bb78c14 + 9b355cd commit 01fce21

File tree

1 file changed

+7
-7
lines changed
  • arch/x86/kernel/cpu/microcode

1 file changed

+7
-7
lines changed

arch/x86/kernel/cpu/microcode/core.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
#define pr_fmt(fmt) "microcode: " fmt
1919

20-
#include <linux/platform_device.h>
2120
#include <linux/stop_machine.h>
21+
#include <linux/device/faux.h>
2222
#include <linux/syscore_ops.h>
2323
#include <linux/miscdevice.h>
2424
#include <linux/capability.h>
@@ -249,7 +249,7 @@ static void reload_early_microcode(unsigned int cpu)
249249
}
250250

251251
/* fake device for request_firmware */
252-
static struct platform_device *microcode_pdev;
252+
static struct faux_device *microcode_fdev;
253253

254254
#ifdef CONFIG_MICROCODE_LATE_LOADING
255255
/*
@@ -690,7 +690,7 @@ static int load_late_locked(void)
690690
if (!setup_cpus())
691691
return -EBUSY;
692692

693-
switch (microcode_ops->request_microcode_fw(0, &microcode_pdev->dev)) {
693+
switch (microcode_ops->request_microcode_fw(0, &microcode_fdev->dev)) {
694694
case UCODE_NEW:
695695
return load_late_stop_cpus(false);
696696
case UCODE_NEW_SAFE:
@@ -841,9 +841,9 @@ static int __init microcode_init(void)
841841
if (early_data.new_rev)
842842
pr_info_once("Updated early from: 0x%08x\n", early_data.old_rev);
843843

844-
microcode_pdev = platform_device_register_simple("microcode", -1, NULL, 0);
845-
if (IS_ERR(microcode_pdev))
846-
return PTR_ERR(microcode_pdev);
844+
microcode_fdev = faux_device_create("microcode", NULL, NULL);
845+
if (!microcode_fdev)
846+
return -ENODEV;
847847

848848
dev_root = bus_get_dev_root(&cpu_subsys);
849849
if (dev_root) {
@@ -862,7 +862,7 @@ static int __init microcode_init(void)
862862
return 0;
863863

864864
out_pdev:
865-
platform_device_unregister(microcode_pdev);
865+
faux_device_destroy(microcode_fdev);
866866
return error;
867867

868868
}

0 commit comments

Comments
 (0)