hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/sbus/char/flash.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /* flash.c: Allow mmap access to the OBP Flash, for OBP updates.
23 *
34 * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be)
....@@ -16,7 +17,6 @@
1617 #include <linux/of_device.h>
1718
1819 #include <linux/uaccess.h>
19
-#include <asm/pgtable.h>
2020 #include <asm/io.h>
2121 #include <asm/upa.h>
2222
....@@ -29,8 +29,6 @@
2929 unsigned long write_size; /* Size of write area */
3030 unsigned long busy; /* In use? */
3131 } flash;
32
-
33
-#define FLASH_MINOR 152
3432
3533 static int
3634 flash_mmap(struct file *file, struct vm_area_struct *vma)
....@@ -156,7 +154,7 @@
156154 .release = flash_release,
157155 };
158156
159
-static struct miscdevice flash_dev = { FLASH_MINOR, "flash", &flash_fops };
157
+static struct miscdevice flash_dev = { SBUS_FLASH_MINOR, "flash", &flash_fops };
160158
161159 static int flash_probe(struct platform_device *op)
162160 {
....@@ -165,9 +163,9 @@
165163
166164 parent = dp->parent;
167165
168
- if (strcmp(parent->name, "sbus") &&
169
- strcmp(parent->name, "sbi") &&
170
- strcmp(parent->name, "ebus"))
166
+ if (!of_node_name_eq(parent, "sbus") &&
167
+ !of_node_name_eq(parent, "sbi") &&
168
+ !of_node_name_eq(parent, "ebus"))
171169 return -ENODEV;
172170
173171 flash.read_base = op->resource[0].start;