|
14 | 14 | #include "mm_communication.h" |
15 | 15 |
|
16 | 16 | static struct efivars tee_efivars; |
17 | | -static struct efivar_operations tee_efivar_ops; |
18 | 17 |
|
19 | 18 | static size_t max_buffer_size; /* comm + var + func + data */ |
20 | 19 | static size_t max_payload_size; /* func + data */ |
@@ -520,6 +519,15 @@ static void tee_stmm_restore_efivars_generic_ops(void) |
520 | 519 | efivars_generic_ops_register(); |
521 | 520 | } |
522 | 521 |
|
| 522 | +static const struct efivar_operations tee_efivar_ops = { |
| 523 | + .get_variable = tee_get_variable, |
| 524 | + .get_next_variable = tee_get_next_variable, |
| 525 | + .set_variable = tee_set_variable, |
| 526 | + .set_variable_nonblocking = tee_set_variable_nonblocking, |
| 527 | + .query_variable_store = efi_query_variable_store, |
| 528 | + .query_variable_info = tee_query_variable_info, |
| 529 | +}; |
| 530 | + |
523 | 531 | static int tee_stmm_efi_probe(struct tee_client_device *tee_dev) |
524 | 532 | { |
525 | 533 | struct device *dev = &tee_dev->dev; |
@@ -558,13 +566,6 @@ static int tee_stmm_efi_probe(struct tee_client_device *tee_dev) |
558 | 566 | MM_VARIABLE_COMMUNICATE_SIZE + |
559 | 567 | max_payload_size; |
560 | 568 |
|
561 | | - tee_efivar_ops.get_variable = tee_get_variable; |
562 | | - tee_efivar_ops.get_next_variable = tee_get_next_variable; |
563 | | - tee_efivar_ops.set_variable = tee_set_variable; |
564 | | - tee_efivar_ops.set_variable_nonblocking = tee_set_variable_nonblocking; |
565 | | - tee_efivar_ops.query_variable_store = efi_query_variable_store; |
566 | | - tee_efivar_ops.query_variable_info = tee_query_variable_info; |
567 | | - |
568 | 569 | efivars_generic_ops_unregister(); |
569 | 570 | pr_info("Using TEE-based EFI runtime variable services\n"); |
570 | 571 | efivars_register(&tee_efivars, &tee_efivar_ops); |
|
0 commit comments