forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 cde9070d9970eef1f7ec2360586c802a16230ad8
kernel/arch/powerpc/platforms/pseries/ibmebus.c
....@@ -40,13 +40,14 @@
4040 #include <linux/export.h>
4141 #include <linux/console.h>
4242 #include <linux/kobject.h>
43
-#include <linux/dma-mapping.h>
43
+#include <linux/dma-map-ops.h>
4444 #include <linux/interrupt.h>
4545 #include <linux/of.h>
4646 #include <linux/slab.h>
4747 #include <linux/stat.h>
4848 #include <linux/of_platform.h>
4949 #include <asm/ibmebus.h>
50
+#include <asm/machdep.h>
5051
5152 static struct device ibmebus_bus_device = { /* fake "parent" device */
5253 .init_name = "ibmebus",
....@@ -147,13 +148,13 @@
147148 .unmap_page = ibmebus_unmap_page,
148149 };
149150
150
-static int ibmebus_match_path(struct device *dev, void *data)
151
+static int ibmebus_match_path(struct device *dev, const void *data)
151152 {
152153 struct device_node *dn = to_platform_device(dev)->dev.of_node;
153154 return (of_find_node_by_path(data) == dn);
154155 }
155156
156
-static int ibmebus_match_node(struct device *dev, void *data)
157
+static int ibmebus_match_node(struct device *dev, const void *data)
157158 {
158159 return to_platform_device(dev)->dev.of_node == data;
159160 }
....@@ -261,8 +262,7 @@
261262 return out;
262263 }
263264
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)
266266 {
267267 struct device_node *dn = NULL;
268268 struct device *dev;
....@@ -298,10 +298,9 @@
298298 return rc;
299299 return count;
300300 }
301
-static BUS_ATTR(probe, 0200, NULL, ibmebus_store_probe);
301
+static BUS_ATTR_WO(probe);
302302
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)
305304 {
306305 struct device *dev;
307306 char *path;
....@@ -325,7 +324,7 @@
325324 return -ENODEV;
326325 }
327326 }
328
-static BUS_ATTR(remove, 0200, NULL, ibmebus_store_remove);
327
+static BUS_ATTR_WO(remove);
329328
330329 static struct attribute *ibmbus_bus_attrs[] = {
331330 &bus_attr_probe.attr,
....@@ -404,7 +403,7 @@
404403 struct platform_device *ofdev;
405404
406405 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);
408407 }
409408 static DEVICE_ATTR_RO(name);
410409
....@@ -452,6 +451,7 @@
452451 if (err) {
453452 printk(KERN_WARNING "%s: device_register returned %i\n",
454453 __func__, err);
454
+ put_device(&ibmebus_bus_device);
455455 bus_unregister(&ibmebus_bus_type);
456456
457457 return err;
....@@ -466,4 +466,4 @@
466466
467467 return 0;
468468 }
469
-postcore_initcall(ibmebus_bus_init);
469
+machine_postcore_initcall(pseries, ibmebus_bus_init);