aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-06-18 13:09:59 -0400
committerGrant Likely <grant.likely@secretlab.ca>2010-06-28 15:41:33 -0400
commitb505ff5e7291cca6379549297e3852ce3622d550 (patch)
treea424d99dc5dc7e9e9e40270c41b0f66ccbc58924
parent1636f8ac2b08410df4766449f7c86b912443cd99 (diff)
of: kill struct of_device
Now that the device tree node pointer has been moved out of struct of_device and into the common struct device, there isn't anything unique about of_device anymore. In fact, there isn't much need for a separate of_bus when all busses have access to OF style probing. arch/powerpc and arch/microblaze are moving away from using the of_bus and using the regular platform bus instead for mmio devices. This patch makes of_device the same as platform_device as a stepping stone in migrating of_platform_drivers over to the platform bus. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: David S. Miller <davem@davemloft.net> Cc: Michal Simek <monstr@monstr.eu> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Stephen Rothwell <sfr@canb.auug.org.au>
-rw-r--r--arch/microblaze/include/asm/of_device.h10
-rw-r--r--arch/powerpc/include/asm/of_device.h11
-rw-r--r--arch/powerpc/include/asm/smu.h4
-rw-r--r--arch/sparc/include/asm/device.h4
-rw-r--r--arch/sparc/include/asm/of_device.h14
-rw-r--r--drivers/net/niu.h4
-rw-r--r--include/linux/of_device.h17
7 files changed, 23 insertions, 41 deletions
diff --git a/arch/microblaze/include/asm/of_device.h b/arch/microblaze/include/asm/of_device.h
index 73cb98040982..0a5f3f914b42 100644
--- a/arch/microblaze/include/asm/of_device.h
+++ b/arch/microblaze/include/asm/of_device.h
@@ -15,16 +15,6 @@
15#include <linux/device.h> 15#include <linux/device.h>
16#include <linux/of.h> 16#include <linux/of.h>
17 17
18/*
19 * The of_device is a kind of "base class" that is a superset of
20 * struct device for use by devices attached to an OF node and
21 * probed using OF properties.
22 */
23struct of_device {
24 struct device dev; /* Generic device interface */
25 struct pdev_archdata archdata;
26};
27
28extern ssize_t of_device_get_modalias(struct of_device *ofdev, 18extern ssize_t of_device_get_modalias(struct of_device *ofdev,
29 char *str, ssize_t len); 19 char *str, ssize_t len);
30 20
diff --git a/arch/powerpc/include/asm/of_device.h b/arch/powerpc/include/asm/of_device.h
index 444e97e2982e..cb36632f953c 100644
--- a/arch/powerpc/include/asm/of_device.h
+++ b/arch/powerpc/include/asm/of_device.h
@@ -5,17 +5,6 @@
5#include <linux/device.h> 5#include <linux/device.h>
6#include <linux/of.h> 6#include <linux/of.h>
7 7
8/*
9 * The of_device is a kind of "base class" that is a superset of
10 * struct device for use by devices attached to an OF node and
11 * probed using OF properties.
12 */
13struct of_device
14{
15 struct device dev; /* Generic device interface */
16 struct pdev_archdata archdata;
17};
18
19extern struct of_device *of_device_alloc(struct device_node *np, 8extern struct of_device *of_device_alloc(struct device_node *np,
20 const char *bus_id, 9 const char *bus_id,
21 struct device *parent); 10 struct device *parent);
diff --git a/arch/powerpc/include/asm/smu.h b/arch/powerpc/include/asm/smu.h
index 7ae2753da565..e3bdada8c542 100644
--- a/arch/powerpc/include/asm/smu.h
+++ b/arch/powerpc/include/asm/smu.h
@@ -457,8 +457,8 @@ extern void smu_poll(void);
457 */ 457 */
458extern int smu_init(void); 458extern int smu_init(void);
459extern int smu_present(void); 459extern int smu_present(void);
460struct of_device; 460struct platform_device;
461extern struct of_device *smu_get_ofdev(void); 461extern struct platform_device *smu_get_ofdev(void);
462 462
463 463
464/* 464/*
diff --git a/arch/sparc/include/asm/device.h b/arch/sparc/include/asm/device.h
index f9740d065fe7..fb220e482039 100644
--- a/arch/sparc/include/asm/device.h
+++ b/arch/sparc/include/asm/device.h
@@ -9,13 +9,13 @@
9#include <asm/openprom.h> 9#include <asm/openprom.h>
10 10
11struct device_node; 11struct device_node;
12struct of_device; 12struct platform_device;
13 13
14struct dev_archdata { 14struct dev_archdata {
15 void *iommu; 15 void *iommu;
16 void *stc; 16 void *stc;
17 void *host_controller; 17 void *host_controller;
18 struct of_device *op; 18 struct platform_device *op;
19 int numa_node; 19 int numa_node;
20}; 20};
21 21
diff --git a/arch/sparc/include/asm/of_device.h b/arch/sparc/include/asm/of_device.h
index 6d1844a547b4..22b9828fe693 100644
--- a/arch/sparc/include/asm/of_device.h
+++ b/arch/sparc/include/asm/of_device.h
@@ -7,20 +7,6 @@
7#include <linux/mod_devicetable.h> 7#include <linux/mod_devicetable.h>
8#include <asm/openprom.h> 8#include <asm/openprom.h>
9 9
10/*
11 * The of_device is a kind of "base class" that is a superset of
12 * struct device for use by devices attached to an OF node and
13 * probed using OF properties.
14 */
15struct of_device
16{
17 struct device dev;
18 u32 num_resources;
19 struct resource *resource;
20
21 struct pdev_archdata archdata;
22};
23
24extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name); 10extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name);
25extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size); 11extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size);
26 12
diff --git a/drivers/net/niu.h b/drivers/net/niu.h
index d6715465f35d..a41fa8ebe05f 100644
--- a/drivers/net/niu.h
+++ b/drivers/net/niu.h
@@ -3236,7 +3236,7 @@ struct niu_phy_ops {
3236 int (*link_status)(struct niu *np, int *); 3236 int (*link_status)(struct niu *np, int *);
3237}; 3237};
3238 3238
3239struct of_device; 3239struct platform_device;
3240struct niu { 3240struct niu {
3241 void __iomem *regs; 3241 void __iomem *regs;
3242 struct net_device *dev; 3242 struct net_device *dev;
@@ -3297,7 +3297,7 @@ struct niu {
3297 struct niu_vpd vpd; 3297 struct niu_vpd vpd;
3298 u32 eeprom_len; 3298 u32 eeprom_len;
3299 3299
3300 struct of_device *op; 3300 struct platform_device *op;
3301 void __iomem *vir_regs_1; 3301 void __iomem *vir_regs_1;
3302 void __iomem *vir_regs_2; 3302 void __iomem *vir_regs_2;
3303}; 3303};
diff --git a/include/linux/of_device.h b/include/linux/of_device.h
index 11651facc5f1..a3ae5900fc58 100644
--- a/include/linux/of_device.h
+++ b/include/linux/of_device.h
@@ -3,9 +3,26 @@
3 3
4#ifdef CONFIG_OF_DEVICE 4#ifdef CONFIG_OF_DEVICE
5#include <linux/device.h> 5#include <linux/device.h>
6#include <linux/platform_device.h>
6#include <linux/of.h> 7#include <linux/of.h>
7#include <linux/mod_devicetable.h> 8#include <linux/mod_devicetable.h>
8 9
10
11/*
12 * The of_device *was* a kind of "base class" that was a superset of
13 * struct device for use by devices attached to an OF node and probed
14 * using OF properties. However, the important bit of OF-style
15 * probing, namely the device node pointer, has been moved into the
16 * common struct device when CONFIG_OF is set to make OF-style probing
17 * available to all bus types. So now, just make of_device and
18 * platform_device equivalent so that current of_platform bus users
19 * can be transparently migrated over to using the platform bus.
20 *
21 * This line will go away once all references to of_device are removed
22 * from the kernel.
23 */
24#define of_device platform_device
25
9#include <asm/of_device.h> 26#include <asm/of_device.h>
10 27
11#define to_of_device(d) container_of(d, struct of_device, dev) 28#define to_of_device(d) container_of(d, struct of_device, dev)