diff options
Diffstat (limited to 'drivers/bus')
-rw-r--r-- | drivers/bus/Kconfig | 2 | ||||
-rw-r--r-- | drivers/bus/acpi.c | 47 | ||||
-rw-r--r-- | drivers/bus/imx-weim.c | 18 | ||||
-rw-r--r-- | drivers/bus/mvebu-mbus.c | 3 | ||||
-rw-r--r-- | drivers/bus/omap-gpmc.c | 30 | ||||
-rw-r--r-- | drivers/bus/ti-sysc.c | 11 |
6 files changed, 45 insertions, 66 deletions
diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig index e622ed239c..b480cf8bff 100644 --- a/drivers/bus/Kconfig +++ b/drivers/bus/Kconfig @@ -29,7 +29,7 @@ config MVEBU_MBUS config ACPI bool "Advanced Configuration and Power Interface (ACPI)" default y - depends on EFI_BOOTUP + depends on EFI_PAYLOAD help Driver needed for supporting drivers probed from ACPI tables. The root SDT is found via UEFI. diff --git a/drivers/bus/acpi.c b/drivers/bus/acpi.c index 63d3f618b4..5936170733 100644 --- a/drivers/bus/acpi.c +++ b/drivers/bus/acpi.c @@ -84,7 +84,7 @@ static struct sig_desc { { /* sentinel */ } }; -static struct acpi_sdt *acpi_get_dev_sdt(struct device_d *dev) +static struct acpi_sdt *acpi_get_dev_sdt(struct device *dev) { int i; @@ -96,7 +96,7 @@ static struct acpi_sdt *acpi_get_dev_sdt(struct device_d *dev) return NULL; } -static void acpi_devinfo(struct device_d *dev) +static void acpi_devinfo(struct device *dev) { struct acpi_sdt *sdt = acpi_get_dev_sdt(dev); struct sig_desc *sig_desc; @@ -120,26 +120,20 @@ static void acpi_devinfo(struct device_d *dev) printf("CreatorRevision: %u\n", sdt->creator_revision); } -static int acpi_register_device(struct device_d *dev, struct acpi_sdt *sdt) +static int acpi_register_device(struct device *dev, struct acpi_sdt *sdt) { - int ret; - - ret = register_device(dev); - if (ret) - return ret; - device_add_resource(dev, "SDT", (resource_size_t)sdt, sdt->len, IORESOURCE_MEM | IORESOURCE_ROM_COPY | IORESOURCE_ROM_BIOS_COPY); - dev_dbg(dev, "registered as ACPI device\n"); + dev_dbg(dev, "registering as ACPI device\n"); - return 0; + return register_device(dev); } -static struct device_d *acpi_add_device(struct bus_type *bus, +static struct device *acpi_add_device(struct bus_type *bus, acpi_sig_t signature) { - struct device_d *dev; + struct device *dev; dev = xzalloc(sizeof(*dev)); @@ -155,7 +149,7 @@ static struct device_d *acpi_add_device(struct bus_type *bus, static int acpi_register_devices(struct bus_type *bus) { - efi_config_table_t *table = bus->dev->priv; + struct efi_config_table *table = bus->dev->priv; struct acpi_rsdp *rsdp; struct acpi_rsdt *root; size_t entry_count; @@ -192,7 +186,7 @@ static int acpi_register_devices(struct bus_type *bus) return -EIO; } - dev_info(bus->dev, "Found %s (OEM: %.8s) with %lu entries\n", + dev_info(bus->dev, "Found %s (OEM: %.8s) with %zu entries\n", sig, root->sdt.oem_id, entry_count); for (i = 0; i < entry_count; i++) { @@ -203,7 +197,7 @@ static int acpi_register_devices(struct bus_type *bus) return 0; } -static int acpi_bus_match(struct device_d *dev, struct driver_d *drv) +static int acpi_bus_match(struct device *dev, struct driver *drv) { struct acpi_driver *acpidrv = to_acpi_driver(drv); struct acpi_sdt *sdt = acpi_get_dev_sdt(dev); @@ -211,31 +205,16 @@ static int acpi_bus_match(struct device_d *dev, struct driver_d *drv) return acpi_sigcmp(acpidrv->signature, sdt->signature); } -static int acpi_bus_probe(struct device_d *dev) -{ - return dev->driver->probe(dev); -} - -static void acpi_bus_remove(struct device_d *dev) -{ - if (dev->driver->remove) - dev->driver->remove(dev); -} - struct bus_type acpi_bus = { .name = "acpi", .match = acpi_bus_match, - .probe = acpi_bus_probe, - .remove = acpi_bus_remove, }; static int efi_acpi_probe(void) { - efi_config_table_t *table = NULL; - int i; + struct efi_config_table *ect, *table = NULL; - for (i = 0; i < efi_sys_table->nr_tables; i++) { - efi_config_table_t *ect = &efi_sys_table->tables[i]; + for_each_efi_config_table(ect) { /* take ACPI < 2 table only if no ACPI 2.0 is available */ if (!efi_guidcmp(ect->guid, EFI_ACPI_20_TABLE_GUID)) { acpi_bus.name = "acpi2"; @@ -254,4 +233,4 @@ static int efi_acpi_probe(void) acpi_bus.dev->priv = table; return acpi_register_devices(&acpi_bus); } -postcore_initcall(efi_acpi_probe); +postcore_efi_initcall(efi_acpi_probe); diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c index 01a35cfc9f..4907577164 100644 --- a/drivers/bus/imx-weim.c +++ b/drivers/bus/imx-weim.c @@ -64,9 +64,10 @@ static struct of_device_id weim_id_table[] = { }, { } }; +MODULE_DEVICE_TABLE(of, weim_id_table); struct imx_weim { - struct device_d *dev; + struct device *dev; void __iomem *base; struct imx_weim_devtype *devtype; }; @@ -106,26 +107,25 @@ static int weim_parse_dt(struct imx_weim *weim) struct device_node *child; int ret; - for_each_child_of_node(weim->dev->device_node, child) { + for_each_child_of_node(weim->dev->of_node, child) { if (!child->name) continue; ret = weim_timing_setup(weim, child); if (ret) { - dev_err(weim->dev, "%s set timing failed.\n", - child->full_name); + dev_err(weim->dev, "%pOF set timing failed.\n", child); return ret; } } - ret = of_platform_populate(weim->dev->device_node, NULL, weim->dev); + ret = of_platform_populate(weim->dev->of_node, NULL, weim->dev); if (ret) - dev_err(weim->dev, "%s fail to create devices.\n", - weim->dev->device_node->full_name); + dev_err(weim->dev, "%pOF failed to create devices.\n", + weim->dev->of_node); return ret; } -static int weim_probe(struct device_d *dev) +static int weim_probe(struct device *dev) { struct resource *iores; struct imx_weim_devtype *devtype; @@ -163,7 +163,7 @@ weim_err: return ret; } -static struct driver_d weim_driver = { +static struct driver weim_driver = { .name = "imx-weim", .of_compatible = DRV_OF_COMPAT(weim_id_table), .probe = weim_probe, diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c index 46fe5dd398..3e3d3ae2b6 100644 --- a/drivers/bus/mvebu-mbus.c +++ b/drivers/bus/mvebu-mbus.c @@ -60,7 +60,7 @@ #include <of.h> #include <of_address.h> #include <linux/mbus.h> -#include <mach/common.h> +#include <mach/mvebu/common.h> /* DDR target is the same on all platforms */ #define TARGET_DDR 0 @@ -483,6 +483,7 @@ static struct of_device_id mvebu_mbus_dt_ids[] = { #endif { }, }; +MODULE_DEVICE_TABLE(of, mvebu_mbus_dt_ids); /* * Public API of the driver diff --git a/drivers/bus/omap-gpmc.c b/drivers/bus/omap-gpmc.c index 5f65d59911..f720933a0a 100644 --- a/drivers/bus/omap-gpmc.c +++ b/drivers/bus/omap-gpmc.c @@ -16,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 @@ -141,7 +141,7 @@ struct gpmc_settings { }; struct imx_gpmc { - struct device_d *dev; + struct device *dev; void __iomem *base; struct imx_gpmc_devtype *devtype; }; @@ -452,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; @@ -464,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; } @@ -523,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; @@ -537,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 = {}; @@ -548,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; } @@ -600,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); @@ -652,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, diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c index ff9d2f81cd..967c9d1f57 100644 --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -8,15 +8,15 @@ #include <of.h> #include <linux/err.h> -static int ti_sysc_probe(struct device_d *dev) +static int ti_sysc_probe(struct device *dev) { int ret; - ret = of_platform_populate(dev->device_node, + ret = of_platform_populate(dev->of_node, of_default_bus_match_table, dev); if (ret) - dev_err(dev, "%s fail to create devices.\n", - dev->device_node->full_name); + dev_err(dev, "%pOF failed to create devices.\n", + dev->of_node); return ret; }; @@ -27,8 +27,9 @@ static struct of_device_id ti_sysc_dt_ids[] = { { .compatible = "ti,sysc-omap2",}, { }, }; +MODULE_DEVICE_TABLE(of, ti_sysc_dt_ids); -static struct driver_d ti_sysc_driver = { +static struct driver ti_sysc_driver = { .name = "ti-sysc", .probe = ti_sysc_probe, .of_compatible = DRV_OF_COMPAT(ti_sysc_dt_ids), |