@@ -186,7 +186,7 @@ static int __sev_platform_init_locked(struct sev_data_init *data, int *error)
return 0;
if (!data)
- data = psp->sev_init;
+ data = &psp->cmd_buf;
rc = __sev_do_cmd_locked(SEV_CMD_INIT, data, error);
if (rc)
@@ -282,7 +282,7 @@ static void sev_exit(struct kref *ref)
misc_deregister(&misc_dev->misc);
}
-static int sev_ops_init(struct psp_device *psp)
+static int sev_misc_init(struct psp_device *psp)
{
struct device *dev = psp->dev;
int ret;
@@ -319,10 +319,6 @@ static int sev_ops_init(struct psp_device *psp)
if (!psp->sev_status)
return -ENOMEM;
- psp->sev_init = devm_kzalloc(dev, sizeof(*psp->sev_init), GFP_KERNEL);
- if (!psp->sev_init)
- return -ENOMEM;
-
init_waitqueue_head(&psp->sev_int_queue);
psp->sev_misc = misc_dev;
dev_dbg(dev, "registered SEV device\n");
@@ -338,7 +334,7 @@ static int sev_init(struct psp_device *psp)
return 1;
}
- return sev_ops_init(psp);
+ return sev_misc_init(psp);
}
int psp_dev_init(struct sp_device *sp)
@@ -77,7 +77,7 @@ struct psp_device {
wait_queue_head_t sev_int_queue;
struct sev_misc_dev *sev_misc;
struct sev_user_data_status *sev_status;
- struct sev_data_init *sev_init;
+ struct sev_data_init cmd_buf;
};
#endif /* __PSP_DEV_H */
@@ -626,11 +626,7 @@ sev_guest_activate(struct sev_data_activate *data, int *error) { return -ENODEV;
static inline int sev_guest_df_flush(int *error) { return -ENODEV; }
static inline int
-sev_issue_cmd_external_user(struct file *filep,
- unsigned int id, void *data, int *error)
-{
- return -ENODEV;
-}
+sev_issue_cmd_external_user(struct file *filep, unsigned int id, void *data, int *error) { return -ENODEV; }
#endif /* CONFIG_CRYPTO_DEV_SP_PSP */