mirror of
https://github.com/intel/linux-sgx-driver
synced 2026-06-08 14:49:53 +00:00
Older kernels than 3.10 do not register the epc device as a
platform device causing SGX module initialization to fail. This fix includes registering a simple isgx device explicitely. Signed-off-by: Serge Ayoun <serge.ayoun@intel.com>
This commit is contained in:
+22
@@ -412,6 +412,28 @@ static struct platform_driver sgx_drv = {
|
||||
},
|
||||
};
|
||||
|
||||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 10, 0))
|
||||
module_platform_driver(sgx_drv);
|
||||
#else
|
||||
static struct platform_device *pdev;
|
||||
int init_sgx_module(void)
|
||||
{
|
||||
platform_driver_register(&sgx_drv);
|
||||
pdev = platform_device_register_simple("intel_sgx", 0, NULL, 0);
|
||||
if (IS_ERR(pdev))
|
||||
pr_err("platform_device_register_simple failed\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
void cleanup_sgx_module(void)
|
||||
{
|
||||
dev_set_uevent_suppress(&pdev->dev, true);
|
||||
platform_device_unregister(pdev);
|
||||
platform_driver_unregister(&sgx_drv);
|
||||
}
|
||||
|
||||
module_init(init_sgx_module);
|
||||
module_exit(cleanup_sgx_module);
|
||||
#endif
|
||||
|
||||
MODULE_LICENSE("Dual BSD/GPL");
|
||||
|
||||
Reference in New Issue
Block a user