forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/arch/x86/platform/intel-quark/imr.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /**
23 * imr.c -- Intel Isolated Memory Region driver
34 *
....@@ -28,13 +29,14 @@
2829 #include <asm/cpu_device_id.h>
2930 #include <asm/imr.h>
3031 #include <asm/iosf_mbi.h>
32
+#include <asm/io.h>
33
+
3134 #include <linux/debugfs.h>
3235 #include <linux/init.h>
3336 #include <linux/mm.h>
3437 #include <linux/types.h>
3538
3639 struct imr_device {
37
- struct dentry *file;
3840 bool init;
3941 struct mutex lock;
4042 int max_imr;
....@@ -230,13 +232,11 @@
230232 * imr_debugfs_register - register debugfs hooks.
231233 *
232234 * @idev: pointer to imr_device structure.
233
- * @return: 0 on success - errno on failure.
234235 */
235
-static int imr_debugfs_register(struct imr_device *idev)
236
+static void imr_debugfs_register(struct imr_device *idev)
236237 {
237
- idev->file = debugfs_create_file("imr_state", 0444, NULL, idev,
238
- &imr_dbgfs_state_fops);
239
- return PTR_ERR_OR_ZERO(idev->file);
238
+ debugfs_create_file("imr_state", 0444, NULL, idev,
239
+ &imr_dbgfs_state_fops);
240240 }
241241
242242 /**
....@@ -569,7 +569,7 @@
569569 }
570570
571571 static const struct x86_cpu_id imr_ids[] __initconst = {
572
- { X86_VENDOR_INTEL, 5, 9 }, /* Intel Quark SoC X1000. */
572
+ X86_MATCH_VENDOR_FAM_MODEL(INTEL, 5, INTEL_FAM5_QUARK_X1000, NULL),
573573 {}
574574 };
575575
....@@ -581,7 +581,6 @@
581581 static int __init imr_init(void)
582582 {
583583 struct imr_device *idev = &imr_dev;
584
- int ret;
585584
586585 if (!x86_match_cpu(imr_ids) || !iosf_mbi_available())
587586 return -ENODEV;
....@@ -591,9 +590,7 @@
591590 idev->init = true;
592591
593592 mutex_init(&idev->lock);
594
- ret = imr_debugfs_register(idev);
595
- if (ret != 0)
596
- pr_warn("debugfs register failed!\n");
593
+ imr_debugfs_register(idev);
597594 imr_fixup_memmap(idev);
598595 return 0;
599596 }