summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nor/cfi_flash.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/nor/cfi_flash.c')
-rw-r--r--drivers/mtd/nor/cfi_flash.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/drivers/mtd/nor/cfi_flash.c b/drivers/mtd/nor/cfi_flash.c
index ffd29d80a7..ac46575004 100644
--- a/drivers/mtd/nor/cfi_flash.c
+++ b/drivers/mtd/nor/cfi_flash.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
/*
* (C) Copyright 2002-2004
* Brad Kemp, Seranoa Networks, Brad.Kemp@seranoa.com
@@ -10,18 +11,6 @@
*
* Copyright (C) 2006
* Tolunay Orkun <listmember@orkun.us>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- *
*/
/* The DEBUG define must be before common to enable debugging */
@@ -769,7 +758,7 @@ static void cfi_info_one(struct flash_info *info)
return;
}
-static void cfi_info(struct device_d *dev)
+static void cfi_info(struct device *dev)
{
struct cfi_priv *priv = dev->priv;
int i;
@@ -976,7 +965,10 @@ static int cfi_probe_one(struct flash_info *info, int num)
return PTR_ERR(iores);
info->base = IOMEM(iores->start);
- /* TODO: either remap memory region or disable NULL pointer page */
+ /*
+ * Platforms hitting this should remap memory region, e.g. via virtual-reg
+ * device tree property or disable MMU.
+ */
if (IS_ENABLED(CONFIG_MMU) && iores->start == 0)
return -EPERM;
@@ -995,7 +987,7 @@ static int cfi_probe_one(struct flash_info *info, int num)
return 0;
}
-static int cfi_probe(struct device_d *dev)
+static int cfi_probe(struct device *dev)
{
struct cfi_priv *priv;
int i, ret;
@@ -1008,7 +1000,7 @@ static int cfi_probe(struct device_d *dev)
priv->infos = xzalloc(sizeof(*priv->infos) * priv->num_devs);
priv->mtds = xzalloc(sizeof(*priv->mtds) * priv->num_devs);
- of_property_read_string(dev->device_node, "linux,mtd-name", &mtd_name);
+ of_property_read_string(dev->of_node, "linux,mtd-name", &mtd_name);
if (!mtd_name)
mtd_name = dev_name(dev);
@@ -1057,8 +1049,9 @@ static __maybe_unused struct of_device_id cfi_dt_ids[] = {
/* sentinel */
}
};
+MODULE_DEVICE_TABLE(of, cfi_dt_ids);
-static struct driver_d cfi_driver = {
+static struct driver cfi_driver = {
.name = "cfi_flash",
.probe = cfi_probe,
.of_compatible = DRV_OF_COMPAT(cfi_dt_ids),