| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* flash.c: Allow mmap access to the OBP Flash, for OBP updates. |
|---|
| 2 | 3 | * |
|---|
| 3 | 4 | * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) |
|---|
| .. | .. |
|---|
| 16 | 17 | #include <linux/of_device.h> |
|---|
| 17 | 18 | |
|---|
| 18 | 19 | #include <linux/uaccess.h> |
|---|
| 19 | | -#include <asm/pgtable.h> |
|---|
| 20 | 20 | #include <asm/io.h> |
|---|
| 21 | 21 | #include <asm/upa.h> |
|---|
| 22 | 22 | |
|---|
| .. | .. |
|---|
| 29 | 29 | unsigned long write_size; /* Size of write area */ |
|---|
| 30 | 30 | unsigned long busy; /* In use? */ |
|---|
| 31 | 31 | } flash; |
|---|
| 32 | | - |
|---|
| 33 | | -#define FLASH_MINOR 152 |
|---|
| 34 | 32 | |
|---|
| 35 | 33 | static int |
|---|
| 36 | 34 | flash_mmap(struct file *file, struct vm_area_struct *vma) |
|---|
| .. | .. |
|---|
| 156 | 154 | .release = flash_release, |
|---|
| 157 | 155 | }; |
|---|
| 158 | 156 | |
|---|
| 159 | | -static struct miscdevice flash_dev = { FLASH_MINOR, "flash", &flash_fops }; |
|---|
| 157 | +static struct miscdevice flash_dev = { SBUS_FLASH_MINOR, "flash", &flash_fops }; |
|---|
| 160 | 158 | |
|---|
| 161 | 159 | static int flash_probe(struct platform_device *op) |
|---|
| 162 | 160 | { |
|---|
| .. | .. |
|---|
| 165 | 163 | |
|---|
| 166 | 164 | parent = dp->parent; |
|---|
| 167 | 165 | |
|---|
| 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")) |
|---|
| 171 | 169 | return -ENODEV; |
|---|
| 172 | 170 | |
|---|
| 173 | 171 | flash.read_base = op->resource[0].start; |
|---|