diff options
Diffstat (limited to 'drivers/zorro')
-rw-r--r-- | drivers/zorro/zorro-driver.c | 6 | ||||
-rw-r--r-- | drivers/zorro/zorro-sysfs.c | 10 | ||||
-rw-r--r-- | drivers/zorro/zorro.c | 17 | ||||
-rw-r--r-- | drivers/zorro/zorro.h | 2 |
4 files changed, 15 insertions, 20 deletions
diff --git a/drivers/zorro/zorro-driver.c b/drivers/zorro/zorro-driver.c index 025edfccedcf..e7d3af1a223f 100644 --- a/drivers/zorro/zorro-driver.c +++ b/drivers/zorro/zorro-driver.c @@ -118,10 +118,10 @@ EXPORT_SYMBOL(zorro_unregister_driver); * supported, and 0 if there is no match. */ -static int zorro_bus_match(struct device *dev, struct device_driver *drv) +static int zorro_bus_match(struct device *dev, const struct device_driver *drv) { struct zorro_dev *z = to_zorro_dev(dev); - struct zorro_driver *zorro_drv = to_zorro_driver(drv); + const struct zorro_driver *zorro_drv = to_zorro_driver(drv); const struct zorro_device_id *ids = zorro_drv->id_table; if (!ids) @@ -150,7 +150,7 @@ static int zorro_uevent(const struct device *dev, struct kobj_uevent_env *env) return 0; } -struct bus_type zorro_bus_type = { +const struct bus_type zorro_bus_type = { .name = "zorro", .dev_name = "zorro", .dev_groups = zorro_device_attribute_groups, diff --git a/drivers/zorro/zorro-sysfs.c b/drivers/zorro/zorro-sysfs.c index 3d34dba9bb2d..10aedcd21363 100644 --- a/drivers/zorro/zorro-sysfs.c +++ b/drivers/zorro/zorro-sysfs.c @@ -81,7 +81,7 @@ static struct attribute *zorro_device_attrs[] = { }; static ssize_t zorro_read_config(struct file *filp, struct kobject *kobj, - struct bin_attribute *bin_attr, + const struct bin_attribute *bin_attr, char *buf, loff_t off, size_t count) { struct zorro_dev *z = to_zorro_dev(kobj_to_dev(kobj)); @@ -98,23 +98,23 @@ static ssize_t zorro_read_config(struct file *filp, struct kobject *kobj, return memory_read_from_buffer(buf, count, &off, &cd, sizeof(cd)); } -static struct bin_attribute zorro_config_attr = { +static const struct bin_attribute zorro_config_attr = { .attr = { .name = "config", .mode = S_IRUGO, }, .size = sizeof(struct ConfigDev), - .read = zorro_read_config, + .read_new = zorro_read_config, }; -static struct bin_attribute *zorro_device_bin_attrs[] = { +static const struct bin_attribute *const zorro_device_bin_attrs[] = { &zorro_config_attr, NULL }; static const struct attribute_group zorro_device_attr_group = { .attrs = zorro_device_attrs, - .bin_attrs = zorro_device_bin_attrs, + .bin_attrs_new = zorro_device_bin_attrs, }; const struct attribute_group *zorro_device_attribute_groups[] = { diff --git a/drivers/zorro/zorro.c b/drivers/zorro/zorro.c index 1b9928648583..4e23d53d269e 100644 --- a/drivers/zorro/zorro.c +++ b/drivers/zorro/zorro.c @@ -18,6 +18,7 @@ #include <linux/platform_device.h> #include <linux/dma-mapping.h> #include <linux/slab.h> +#include <linux/string_choices.h> #include <asm/byteorder.h> #include <asm/setup.h> @@ -117,17 +118,13 @@ static struct resource __init *zorro_find_parent_resource( int i; for (i = 0; i < bridge->num_resources; i++) { - struct resource *r = &bridge->resource[i]; - - if (zorro_resource_start(z) >= r->start && - zorro_resource_end(z) <= r->end) - return r; + if (resource_contains(&bridge->resource[i], &z->resource)) + return &bridge->resource[i]; } + return &iomem_resource; } - - static int __init amiga_zorro_probe(struct platform_device *pdev) { struct zorro_bus *bus; @@ -156,7 +153,7 @@ static int __init amiga_zorro_probe(struct platform_device *pdev) platform_set_drvdata(pdev, bus); pr_info("Zorro: Probing AutoConfig expansion devices: %u device%s\n", - zorro_num_autocon, zorro_num_autocon == 1 ? "" : "s"); + zorro_num_autocon, str_plural(zorro_num_autocon)); /* First identify all devices ... */ for (i = 0; i < zorro_num_autocon; i++) { @@ -176,9 +173,7 @@ static int __init amiga_zorro_probe(struct platform_device *pdev) z->slotsize = zi->slotsize; sprintf(z->name, "Zorro device %08x", z->id); zorro_name_device(z); - z->resource.start = zi->boardaddr; - z->resource.end = zi->boardaddr + zi->boardsize - 1; - z->resource.name = z->name; + z->resource = DEFINE_RES_MEM_NAMED(zi->boardaddr, zi->boardsize, z->name); r = zorro_find_parent_resource(pdev, z); error = request_resource(r, &z->resource); if (error && !(z->rom.er_Type & ERTF_MEMLIST)) diff --git a/drivers/zorro/zorro.h b/drivers/zorro/zorro.h index f84df9fb4c20..df44e35203fd 100644 --- a/drivers/zorro/zorro.h +++ b/drivers/zorro/zorro.h @@ -4,7 +4,7 @@ * Zorro bus */ -extern struct bus_type zorro_bus_type; +extern const struct bus_type zorro_bus_type; #ifdef CONFIG_ZORRO_NAMES |