diff options
Diffstat (limited to 'drivers/bus/omap-gpmc.c')
-rw-r--r-- | drivers/bus/omap-gpmc.c | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/drivers/bus/omap-gpmc.c b/drivers/bus/omap-gpmc.c index cd5b6d5e03..f720933a0a 100644 --- a/drivers/bus/omap-gpmc.c +++ b/drivers/bus/omap-gpmc.c @@ -1,11 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * OMAP GPMC driver. Based upon the corresponding Linux Code * * Copyright (C) 2013 Sascha Hauer, Pengutronix, <s.hauer@pengutronix.de> - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without any - * warranty of any kind, whether express or implied. */ #include <common.h> #include <driver.h> @@ -19,8 +16,8 @@ #include <linux/clk.h> #include <linux/err.h> #include <linux/mtd/rawnand.h> -#include <mach/gpmc_nand.h> -#include <mach/gpmc.h> +#include <mach/omap/gpmc_nand.h> +#include <mach/omap/gpmc.h> #define GPMC_CS_NUM 8 #define GPMC_NR_WAITPINS 4 @@ -144,7 +141,7 @@ struct gpmc_settings { }; struct imx_gpmc { - struct device_d *dev; + struct device *dev; void __iomem *base; struct imx_gpmc_devtype *devtype; }; @@ -455,7 +452,7 @@ static struct dt_eccmode modes[] = { }, }; -static int gpmc_probe_nand_child(struct device_d *dev, +static int gpmc_probe_nand_child(struct device *dev, struct device_node *child) { u32 val; @@ -467,8 +464,7 @@ static int gpmc_probe_nand_child(struct device_d *dev, int ret, i; if (of_property_read_u32(child, "reg", &val) < 0) { - dev_err(dev, "%s has no 'reg' property\n", - child->full_name); + dev_err(dev, "%pOF has no 'reg' property\n", child); return -ENODEV; } @@ -526,7 +522,7 @@ static int gpmc_probe_nand_child(struct device_d *dev, dev = device_alloc("gpmc_nand", DEVICE_ID_DYNAMIC); device_add_resource(dev, NULL, (resource_size_t)gpmc_base, SZ_4K, IORESOURCE_MEM); device_add_data(dev, &gpmc_nand_data, sizeof(gpmc_nand_data)); - dev->device_node = child; + dev->of_node = child; platform_device_register(dev); return 0; @@ -540,8 +536,8 @@ static int gpmc_probe_nand_child(struct device_d *dev, * Allocates and configures a GPMC chip-select for a child device. * Returns 0 on success and appropriate negative error code on failure. */ -static int gpmc_probe_generic_child(struct device_d *dev, - struct device_node *child) +static int gpmc_probe_generic_child(struct device *dev, + struct device_node *child) { struct gpmc_settings gpmc_s = {}; struct gpmc_timings gpmc_t = {}; @@ -551,14 +547,12 @@ static int gpmc_probe_generic_child(struct device_d *dev, resource_size_t size; if (of_property_read_u32(child, "reg", &cs) < 0) { - dev_err(dev, "%s has no 'reg' property\n", - child->full_name); + dev_err(dev, "%pOF has no 'reg' property\n", child); return -ENODEV; } if (of_address_to_resource(child, 0, &res) < 0) { - dev_err(dev, "%s has malformed 'reg' property\n", - child->full_name); + dev_err(dev, "%pOF has malformed 'reg' property\n", child); return -ENODEV; } @@ -603,9 +597,9 @@ err: return ret; } -static int gpmc_probe(struct device_d *dev) +static int gpmc_probe(struct device *dev) { - struct device_node *child, *node = dev->device_node; + struct device_node *child, *node = dev->of_node; int ret; gpmc_generic_init(0x12); @@ -655,8 +649,9 @@ static struct of_device_id gpmc_id_table[] = { { .compatible = "ti,am3352-gpmc" }, /* am335x devices */ { } }; +MODULE_DEVICE_TABLE(of, gpmc_id_table); -static struct driver_d gpmc_driver = { +static struct driver gpmc_driver = { .name = "omap-gpmc", .of_compatible = DRV_OF_COMPAT(gpmc_id_table), .probe = gpmc_probe, |