@@ -1835,6 +1835,16 @@ static void shutdown_dimm_notify(void *data)
mutex_unlock(&acpi_desc->init_mutex);
}
+static const struct nvdimm_security_ops *acpi_nfit_get_security_ops(int family)
+{
+ switch (family) {
+ case NVDIMM_FAMILY_INTEL:
+ return intel_security_ops;
+ default:
+ return NULL;
+ }
+}
+
static int acpi_nfit_register_dimms(struct acpi_nfit_desc *acpi_desc)
{
struct nfit_mem *nfit_mem;
@@ -358,7 +358,7 @@ static int intel_dimm_security_state(struct nvdimm *nvdimm,
return rc;
}
-const struct nvdimm_security_ops intel_security_ops = {
+static const struct nvdimm_security_ops __intel_security_ops = {
.state = intel_dimm_security_state,
.unlock = intel_dimm_security_unlock,
.change_key = intel_dimm_security_update_passphrase,
@@ -366,3 +366,4 @@ const struct nvdimm_security_ops intel_security_ops = {
.freeze_lock = intel_dimm_security_freeze_lock,
.erase = intel_dimm_security_erase,
};
+const struct nvdimm_security_ops *intel_security_ops = &__intel_security_ops;
@@ -8,7 +8,7 @@
#ifdef CONFIG_X86
-extern const struct nvdimm_security_ops intel_security_ops;
+extern const struct nvdimm_security_ops *intel_security_ops;
#define ND_INTEL_STATUS_SIZE 4
#define ND_INTEL_PASSPHRASE_SIZE 32
@@ -64,19 +64,7 @@ struct nd_intel_overwrite {
struct nd_intel_query_overwrite {
u32 status;
} __packed;
+#else /* CONFIG_X86 */
+#define intel_security_ops (NULL)
#endif /* CONFIG_X86 */
-
-static inline const struct nvdimm_security_ops *
-acpi_nfit_get_security_ops(int family)
-{
- switch (family) {
-#ifdef CONFIG_X86
- case NVDIMM_FAMILY_INTEL:
- return &intel_security_ops;
-#endif
- default:
- return NULL;
- }
-}
-
#endif