aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/include/asm/macio.h2
-rw-r--r--arch/sparc/include/asm/floppy_64.h6
-rw-r--r--arch/sparc/include/asm/parport.h4
-rw-r--r--drivers/of/device.c22
-rw-r--r--drivers/of/platform.c24
-rw-r--r--include/linux/of_device.h10
-rw-r--r--include/linux/of_platform.h16
7 files changed, 42 insertions, 42 deletions
diff --git a/arch/powerpc/include/asm/macio.h b/arch/powerpc/include/asm/macio.h
index 675e159b5ef4..7ab82c825a03 100644
--- a/arch/powerpc/include/asm/macio.h
+++ b/arch/powerpc/include/asm/macio.h
@@ -38,7 +38,7 @@ struct macio_dev
38{ 38{
39 struct macio_bus *bus; /* macio bus this device is on */ 39 struct macio_bus *bus; /* macio bus this device is on */
40 struct macio_dev *media_bay; /* Device is part of a media bay */ 40 struct macio_dev *media_bay; /* Device is part of a media bay */
41 struct of_device ofdev; 41 struct platform_device ofdev;
42 struct device_dma_parameters dma_parms; /* ide needs that */ 42 struct device_dma_parameters dma_parms; /* ide needs that */
43 int n_resources; 43 int n_resources;
44 struct resource resource[MACIO_DEV_COUNT_RESOURCES]; 44 struct resource resource[MACIO_DEV_COUNT_RESOURCES];
diff --git a/arch/sparc/include/asm/floppy_64.h b/arch/sparc/include/asm/floppy_64.h
index 4f5bde638f72..6597ce874d78 100644
--- a/arch/sparc/include/asm/floppy_64.h
+++ b/arch/sparc/include/asm/floppy_64.h
@@ -43,7 +43,7 @@ struct sun_flpy_controller {
43/* You'll only ever find one controller on an Ultra anyways. */ 43/* You'll only ever find one controller on an Ultra anyways. */
44static struct sun_flpy_controller *sun_fdc = (struct sun_flpy_controller *)-1; 44static struct sun_flpy_controller *sun_fdc = (struct sun_flpy_controller *)-1;
45unsigned long fdc_status; 45unsigned long fdc_status;
46static struct of_device *floppy_op = NULL; 46static struct platform_device *floppy_op = NULL;
47 47
48struct sun_floppy_ops { 48struct sun_floppy_ops {
49 unsigned char (*fd_inb) (unsigned long port); 49 unsigned char (*fd_inb) (unsigned long port);
@@ -548,7 +548,7 @@ static unsigned long __init sun_floppy_init(void)
548{ 548{
549 static int initialized = 0; 549 static int initialized = 0;
550 struct device_node *dp; 550 struct device_node *dp;
551 struct of_device *op; 551 struct platform_device *op;
552 const char *prop; 552 const char *prop;
553 char state[128]; 553 char state[128];
554 554
@@ -661,7 +661,7 @@ static unsigned long __init sun_floppy_init(void)
661 config = 0; 661 config = 0;
662 for (dp = ebus_dp->child; dp; dp = dp->sibling) { 662 for (dp = ebus_dp->child; dp; dp = dp->sibling) {
663 if (!strcmp(dp->name, "ecpp")) { 663 if (!strcmp(dp->name, "ecpp")) {
664 struct of_device *ecpp_op; 664 struct platform_device *ecpp_op;
665 665
666 ecpp_op = of_find_device_by_node(dp); 666 ecpp_op = of_find_device_by_node(dp);
667 if (ecpp_op) 667 if (ecpp_op)
diff --git a/arch/sparc/include/asm/parport.h b/arch/sparc/include/asm/parport.h
index 4891fbce1114..4f7afa01b2ae 100644
--- a/arch/sparc/include/asm/parport.h
+++ b/arch/sparc/include/asm/parport.h
@@ -103,7 +103,7 @@ static inline unsigned int get_dma_residue(unsigned int dmanr)
103 return ebus_dma_residue(&sparc_ebus_dmas[dmanr].info); 103 return ebus_dma_residue(&sparc_ebus_dmas[dmanr].info);
104} 104}
105 105
106static int __devinit ecpp_probe(struct of_device *op, const struct of_device_id *match) 106static int __devinit ecpp_probe(struct platform_device *op, const struct of_device_id *match)
107{ 107{
108 unsigned long base = op->resource[0].start; 108 unsigned long base = op->resource[0].start;
109 unsigned long config = op->resource[1].start; 109 unsigned long config = op->resource[1].start;
@@ -192,7 +192,7 @@ out_err:
192 return err; 192 return err;
193} 193}
194 194
195static int __devexit ecpp_remove(struct of_device *op) 195static int __devexit ecpp_remove(struct platform_device *op)
196{ 196{
197 struct parport *p = dev_get_drvdata(&op->dev); 197 struct parport *p = dev_get_drvdata(&op->dev);
198 int slot = p->dma; 198 int slot = p->dma;
diff --git a/drivers/of/device.c b/drivers/of/device.c
index 12a44b493511..0d8a0644f540 100644
--- a/drivers/of/device.c
+++ b/drivers/of/device.c
@@ -26,7 +26,7 @@ const struct of_device_id *of_match_device(const struct of_device_id *matches,
26} 26}
27EXPORT_SYMBOL(of_match_device); 27EXPORT_SYMBOL(of_match_device);
28 28
29struct of_device *of_dev_get(struct of_device *dev) 29struct platform_device *of_dev_get(struct platform_device *dev)
30{ 30{
31 struct device *tmp; 31 struct device *tmp;
32 32
@@ -34,13 +34,13 @@ struct of_device *of_dev_get(struct of_device *dev)
34 return NULL; 34 return NULL;
35 tmp = get_device(&dev->dev); 35 tmp = get_device(&dev->dev);
36 if (tmp) 36 if (tmp)
37 return to_of_device(tmp); 37 return to_platform_device(tmp);
38 else 38 else
39 return NULL; 39 return NULL;
40} 40}
41EXPORT_SYMBOL(of_dev_get); 41EXPORT_SYMBOL(of_dev_get);
42 42
43void of_dev_put(struct of_device *dev) 43void of_dev_put(struct platform_device *dev)
44{ 44{
45 if (dev) 45 if (dev)
46 put_device(&dev->dev); 46 put_device(&dev->dev);
@@ -50,18 +50,18 @@ EXPORT_SYMBOL(of_dev_put);
50static ssize_t devspec_show(struct device *dev, 50static ssize_t devspec_show(struct device *dev,
51 struct device_attribute *attr, char *buf) 51 struct device_attribute *attr, char *buf)
52{ 52{
53 struct of_device *ofdev; 53 struct platform_device *ofdev;
54 54
55 ofdev = to_of_device(dev); 55 ofdev = to_platform_device(dev);
56 return sprintf(buf, "%s\n", ofdev->dev.of_node->full_name); 56 return sprintf(buf, "%s\n", ofdev->dev.of_node->full_name);
57} 57}
58 58
59static ssize_t name_show(struct device *dev, 59static ssize_t name_show(struct device *dev,
60 struct device_attribute *attr, char *buf) 60 struct device_attribute *attr, char *buf)
61{ 61{
62 struct of_device *ofdev; 62 struct platform_device *ofdev;
63 63
64 ofdev = to_of_device(dev); 64 ofdev = to_platform_device(dev);
65 return sprintf(buf, "%s\n", ofdev->dev.of_node->name); 65 return sprintf(buf, "%s\n", ofdev->dev.of_node->name);
66} 66}
67 67
@@ -90,15 +90,15 @@ struct device_attribute of_platform_device_attrs[] = {
90 */ 90 */
91void of_release_dev(struct device *dev) 91void of_release_dev(struct device *dev)
92{ 92{
93 struct of_device *ofdev; 93 struct platform_device *ofdev;
94 94
95 ofdev = to_of_device(dev); 95 ofdev = to_platform_device(dev);
96 of_node_put(ofdev->dev.of_node); 96 of_node_put(ofdev->dev.of_node);
97 kfree(ofdev); 97 kfree(ofdev);
98} 98}
99EXPORT_SYMBOL(of_release_dev); 99EXPORT_SYMBOL(of_release_dev);
100 100
101int of_device_register(struct of_device *ofdev) 101int of_device_register(struct platform_device *ofdev)
102{ 102{
103 BUG_ON(ofdev->dev.of_node == NULL); 103 BUG_ON(ofdev->dev.of_node == NULL);
104 104
@@ -119,7 +119,7 @@ int of_device_register(struct of_device *ofdev)
119} 119}
120EXPORT_SYMBOL(of_device_register); 120EXPORT_SYMBOL(of_device_register);
121 121
122void of_device_unregister(struct of_device *ofdev) 122void of_device_unregister(struct platform_device *ofdev)
123{ 123{
124 device_unregister(&ofdev->dev); 124 device_unregister(&ofdev->dev);
125} 125}
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index f3f1ec81ef48..9f3840cdcde5 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -94,11 +94,11 @@ static int of_platform_device_probe(struct device *dev)
94{ 94{
95 int error = -ENODEV; 95 int error = -ENODEV;
96 struct of_platform_driver *drv; 96 struct of_platform_driver *drv;
97 struct of_device *of_dev; 97 struct platform_device *of_dev;
98 const struct of_device_id *match; 98 const struct of_device_id *match;
99 99
100 drv = to_of_platform_driver(dev->driver); 100 drv = to_of_platform_driver(dev->driver);
101 of_dev = to_of_device(dev); 101 of_dev = to_platform_device(dev);
102 102
103 if (!drv->probe) 103 if (!drv->probe)
104 return error; 104 return error;
@@ -116,7 +116,7 @@ static int of_platform_device_probe(struct device *dev)
116 116
117static int of_platform_device_remove(struct device *dev) 117static int of_platform_device_remove(struct device *dev)
118{ 118{
119 struct of_device *of_dev = to_of_device(dev); 119 struct platform_device *of_dev = to_platform_device(dev);
120 struct of_platform_driver *drv = to_of_platform_driver(dev->driver); 120 struct of_platform_driver *drv = to_of_platform_driver(dev->driver);
121 121
122 if (dev->driver && drv->remove) 122 if (dev->driver && drv->remove)
@@ -126,7 +126,7 @@ static int of_platform_device_remove(struct device *dev)
126 126
127static void of_platform_device_shutdown(struct device *dev) 127static void of_platform_device_shutdown(struct device *dev)
128{ 128{
129 struct of_device *of_dev = to_of_device(dev); 129 struct platform_device *of_dev = to_platform_device(dev);
130 struct of_platform_driver *drv = to_of_platform_driver(dev->driver); 130 struct of_platform_driver *drv = to_of_platform_driver(dev->driver);
131 131
132 if (dev->driver && drv->shutdown) 132 if (dev->driver && drv->shutdown)
@@ -137,7 +137,7 @@ static void of_platform_device_shutdown(struct device *dev)
137 137
138static int of_platform_legacy_suspend(struct device *dev, pm_message_t mesg) 138static int of_platform_legacy_suspend(struct device *dev, pm_message_t mesg)
139{ 139{
140 struct of_device *of_dev = to_of_device(dev); 140 struct platform_device *of_dev = to_platform_device(dev);
141 struct of_platform_driver *drv = to_of_platform_driver(dev->driver); 141 struct of_platform_driver *drv = to_of_platform_driver(dev->driver);
142 int ret = 0; 142 int ret = 0;
143 143
@@ -148,7 +148,7 @@ static int of_platform_legacy_suspend(struct device *dev, pm_message_t mesg)
148 148
149static int of_platform_legacy_resume(struct device *dev) 149static int of_platform_legacy_resume(struct device *dev)
150{ 150{
151 struct of_device *of_dev = to_of_device(dev); 151 struct platform_device *of_dev = to_platform_device(dev);
152 struct of_platform_driver *drv = to_of_platform_driver(dev->driver); 152 struct of_platform_driver *drv = to_of_platform_driver(dev->driver);
153 int ret = 0; 153 int ret = 0;
154 154
@@ -543,11 +543,11 @@ static void of_device_make_bus_id(struct device *dev)
543 * @bus_id: Name to assign to the device. May be null to use default name. 543 * @bus_id: Name to assign to the device. May be null to use default name.
544 * @parent: Parent device. 544 * @parent: Parent device.
545 */ 545 */
546struct of_device *of_device_alloc(struct device_node *np, 546struct platform_device *of_device_alloc(struct device_node *np,
547 const char *bus_id, 547 const char *bus_id,
548 struct device *parent) 548 struct device *parent)
549{ 549{
550 struct of_device *dev; 550 struct platform_device *dev;
551 int rc, i, num_reg = 0, num_irq = 0; 551 int rc, i, num_reg = 0, num_irq = 0;
552 struct resource *res, temp_res; 552 struct resource *res, temp_res;
553 553
@@ -600,11 +600,11 @@ EXPORT_SYMBOL(of_device_alloc);
600 * @bus_id: name to assign device 600 * @bus_id: name to assign device
601 * @parent: Linux device model parent device. 601 * @parent: Linux device model parent device.
602 */ 602 */
603struct of_device *of_platform_device_create(struct device_node *np, 603struct platform_device *of_platform_device_create(struct device_node *np,
604 const char *bus_id, 604 const char *bus_id,
605 struct device *parent) 605 struct device *parent)
606{ 606{
607 struct of_device *dev; 607 struct platform_device *dev;
608 608
609 dev = of_device_alloc(np, bus_id, parent); 609 dev = of_device_alloc(np, bus_id, parent);
610 if (!dev) 610 if (!dev)
@@ -642,7 +642,7 @@ static int of_platform_bus_create(const struct device_node *bus,
642 struct device *parent) 642 struct device *parent)
643{ 643{
644 struct device_node *child; 644 struct device_node *child;
645 struct of_device *dev; 645 struct platform_device *dev;
646 int rc = 0; 646 int rc = 0;
647 647
648 for_each_child_of_node(bus, child) { 648 for_each_child_of_node(bus, child) {
@@ -678,7 +678,7 @@ int of_platform_bus_probe(struct device_node *root,
678 struct device *parent) 678 struct device *parent)
679{ 679{
680 struct device_node *child; 680 struct device_node *child;
681 struct of_device *dev; 681 struct platform_device *dev;
682 int rc = 0; 682 int rc = 0;
683 683
684 if (matches == NULL) 684 if (matches == NULL)
diff --git a/include/linux/of_device.h b/include/linux/of_device.h
index 0f1911994559..e11a0be7893a 100644
--- a/include/linux/of_device.h
+++ b/include/linux/of_device.h
@@ -39,14 +39,14 @@ static inline int of_driver_match_device(const struct device *dev,
39 return of_match_device(drv->of_match_table, dev) != NULL; 39 return of_match_device(drv->of_match_table, dev) != NULL;
40} 40}
41 41
42extern struct of_device *of_dev_get(struct of_device *dev); 42extern struct platform_device *of_dev_get(struct platform_device *dev);
43extern void of_dev_put(struct of_device *dev); 43extern void of_dev_put(struct platform_device *dev);
44 44
45extern int of_device_register(struct of_device *ofdev); 45extern int of_device_register(struct platform_device *ofdev);
46extern void of_device_unregister(struct of_device *ofdev); 46extern void of_device_unregister(struct platform_device *ofdev);
47extern void of_release_dev(struct device *dev); 47extern void of_release_dev(struct device *dev);
48 48
49static inline void of_device_free(struct of_device *dev) 49static inline void of_device_free(struct platform_device *dev)
50{ 50{
51 of_release_dev(&dev->dev); 51 of_release_dev(&dev->dev);
52} 52}
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index a79f59bf61a0..b24c5a5b0426 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -27,13 +27,13 @@ extern const struct of_device_id of_default_bus_ids[];
27 */ 27 */
28struct of_platform_driver 28struct of_platform_driver
29{ 29{
30 int (*probe)(struct of_device* dev, 30 int (*probe)(struct platform_device* dev,
31 const struct of_device_id *match); 31 const struct of_device_id *match);
32 int (*remove)(struct of_device* dev); 32 int (*remove)(struct platform_device* dev);
33 33
34 int (*suspend)(struct of_device* dev, pm_message_t state); 34 int (*suspend)(struct platform_device* dev, pm_message_t state);
35 int (*resume)(struct of_device* dev); 35 int (*resume)(struct platform_device* dev);
36 int (*shutdown)(struct of_device* dev); 36 int (*shutdown)(struct platform_device* dev);
37 37
38 struct device_driver driver; 38 struct device_driver driver;
39 struct platform_driver platform_driver; 39 struct platform_driver platform_driver;
@@ -49,16 +49,16 @@ extern void of_unregister_driver(struct of_platform_driver *drv);
49extern int of_register_platform_driver(struct of_platform_driver *drv); 49extern int of_register_platform_driver(struct of_platform_driver *drv);
50extern void of_unregister_platform_driver(struct of_platform_driver *drv); 50extern void of_unregister_platform_driver(struct of_platform_driver *drv);
51 51
52extern struct of_device *of_device_alloc(struct device_node *np, 52extern struct platform_device *of_device_alloc(struct device_node *np,
53 const char *bus_id, 53 const char *bus_id,
54 struct device *parent); 54 struct device *parent);
55extern struct of_device *of_find_device_by_node(struct device_node *np); 55extern struct platform_device *of_find_device_by_node(struct device_node *np);
56 56
57extern int of_bus_type_init(struct bus_type *bus, const char *name); 57extern int of_bus_type_init(struct bus_type *bus, const char *name);
58 58
59#if !defined(CONFIG_SPARC) /* SPARC has its own device registration method */ 59#if !defined(CONFIG_SPARC) /* SPARC has its own device registration method */
60/* Platform devices and busses creation */ 60/* Platform devices and busses creation */
61extern struct of_device *of_platform_device_create(struct device_node *np, 61extern struct platform_device *of_platform_device_create(struct device_node *np,
62 const char *bus_id, 62 const char *bus_id,
63 struct device *parent); 63 struct device *parent);
64 64