.. | .. |
---|
40 | 40 | #include <linux/export.h> |
---|
41 | 41 | #include <linux/console.h> |
---|
42 | 42 | #include <linux/kobject.h> |
---|
43 | | -#include <linux/dma-mapping.h> |
---|
| 43 | +#include <linux/dma-map-ops.h> |
---|
44 | 44 | #include <linux/interrupt.h> |
---|
45 | 45 | #include <linux/of.h> |
---|
46 | 46 | #include <linux/slab.h> |
---|
47 | 47 | #include <linux/stat.h> |
---|
48 | 48 | #include <linux/of_platform.h> |
---|
49 | 49 | #include <asm/ibmebus.h> |
---|
| 50 | +#include <asm/machdep.h> |
---|
50 | 51 | |
---|
51 | 52 | static struct device ibmebus_bus_device = { /* fake "parent" device */ |
---|
52 | 53 | .init_name = "ibmebus", |
---|
.. | .. |
---|
147 | 148 | .unmap_page = ibmebus_unmap_page, |
---|
148 | 149 | }; |
---|
149 | 150 | |
---|
150 | | -static int ibmebus_match_path(struct device *dev, void *data) |
---|
| 151 | +static int ibmebus_match_path(struct device *dev, const void *data) |
---|
151 | 152 | { |
---|
152 | 153 | struct device_node *dn = to_platform_device(dev)->dev.of_node; |
---|
153 | 154 | return (of_find_node_by_path(data) == dn); |
---|
154 | 155 | } |
---|
155 | 156 | |
---|
156 | | -static int ibmebus_match_node(struct device *dev, void *data) |
---|
| 157 | +static int ibmebus_match_node(struct device *dev, const void *data) |
---|
157 | 158 | { |
---|
158 | 159 | return to_platform_device(dev)->dev.of_node == data; |
---|
159 | 160 | } |
---|
.. | .. |
---|
261 | 262 | return out; |
---|
262 | 263 | } |
---|
263 | 264 | |
---|
264 | | -static ssize_t ibmebus_store_probe(struct bus_type *bus, |
---|
265 | | - const char *buf, size_t count) |
---|
| 265 | +static ssize_t probe_store(struct bus_type *bus, const char *buf, size_t count) |
---|
266 | 266 | { |
---|
267 | 267 | struct device_node *dn = NULL; |
---|
268 | 268 | struct device *dev; |
---|
.. | .. |
---|
298 | 298 | return rc; |
---|
299 | 299 | return count; |
---|
300 | 300 | } |
---|
301 | | -static BUS_ATTR(probe, 0200, NULL, ibmebus_store_probe); |
---|
| 301 | +static BUS_ATTR_WO(probe); |
---|
302 | 302 | |
---|
303 | | -static ssize_t ibmebus_store_remove(struct bus_type *bus, |
---|
304 | | - const char *buf, size_t count) |
---|
| 303 | +static ssize_t remove_store(struct bus_type *bus, const char *buf, size_t count) |
---|
305 | 304 | { |
---|
306 | 305 | struct device *dev; |
---|
307 | 306 | char *path; |
---|
.. | .. |
---|
325 | 324 | return -ENODEV; |
---|
326 | 325 | } |
---|
327 | 326 | } |
---|
328 | | -static BUS_ATTR(remove, 0200, NULL, ibmebus_store_remove); |
---|
| 327 | +static BUS_ATTR_WO(remove); |
---|
329 | 328 | |
---|
330 | 329 | static struct attribute *ibmbus_bus_attrs[] = { |
---|
331 | 330 | &bus_attr_probe.attr, |
---|
.. | .. |
---|
404 | 403 | struct platform_device *ofdev; |
---|
405 | 404 | |
---|
406 | 405 | ofdev = to_platform_device(dev); |
---|
407 | | - return sprintf(buf, "%s\n", ofdev->dev.of_node->name); |
---|
| 406 | + return sprintf(buf, "%pOFn\n", ofdev->dev.of_node); |
---|
408 | 407 | } |
---|
409 | 408 | static DEVICE_ATTR_RO(name); |
---|
410 | 409 | |
---|
.. | .. |
---|
452 | 451 | if (err) { |
---|
453 | 452 | printk(KERN_WARNING "%s: device_register returned %i\n", |
---|
454 | 453 | __func__, err); |
---|
| 454 | + put_device(&ibmebus_bus_device); |
---|
455 | 455 | bus_unregister(&ibmebus_bus_type); |
---|
456 | 456 | |
---|
457 | 457 | return err; |
---|
.. | .. |
---|
466 | 466 | |
---|
467 | 467 | return 0; |
---|
468 | 468 | } |
---|
469 | | -postcore_initcall(ibmebus_bus_init); |
---|
| 469 | +machine_postcore_initcall(pseries, ibmebus_bus_init); |
---|