diff options
Diffstat (limited to 'arch/microblaze')
-rw-r--r-- | arch/microblaze/include/asm/device.h | 16 | ||||
-rw-r--r-- | arch/microblaze/include/asm/of_device.h | 3 | ||||
-rw-r--r-- | arch/microblaze/include/asm/scatterlist.h | 2 | ||||
-rw-r--r-- | arch/microblaze/kernel/of_device.c | 13 | ||||
-rw-r--r-- | arch/microblaze/kernel/of_platform.c | 6 |
5 files changed, 13 insertions, 27 deletions
diff --git a/arch/microblaze/include/asm/device.h b/arch/microblaze/include/asm/device.h index 402b46e630f6..123b2fe72d01 100644 --- a/arch/microblaze/include/asm/device.h +++ b/arch/microblaze/include/asm/device.h | |||
@@ -12,29 +12,15 @@ | |||
12 | struct device_node; | 12 | struct device_node; |
13 | 13 | ||
14 | struct dev_archdata { | 14 | struct dev_archdata { |
15 | /* Optional pointer to an OF device node */ | ||
16 | struct device_node *of_node; | ||
17 | |||
18 | /* DMA operations on that device */ | 15 | /* DMA operations on that device */ |
19 | struct dma_map_ops *dma_ops; | 16 | struct dma_map_ops *dma_ops; |
20 | void *dma_data; | 17 | void *dma_data; |
21 | }; | 18 | }; |
22 | 19 | ||
23 | struct pdev_archdata { | 20 | struct pdev_archdata { |
21 | u64 dma_mask; | ||
24 | }; | 22 | }; |
25 | 23 | ||
26 | static inline void dev_archdata_set_node(struct dev_archdata *ad, | ||
27 | struct device_node *np) | ||
28 | { | ||
29 | ad->of_node = np; | ||
30 | } | ||
31 | |||
32 | static inline struct device_node * | ||
33 | dev_archdata_get_node(const struct dev_archdata *ad) | ||
34 | { | ||
35 | return ad->of_node; | ||
36 | } | ||
37 | |||
38 | #endif /* _ASM_MICROBLAZE_DEVICE_H */ | 24 | #endif /* _ASM_MICROBLAZE_DEVICE_H */ |
39 | 25 | ||
40 | 26 | ||
diff --git a/arch/microblaze/include/asm/of_device.h b/arch/microblaze/include/asm/of_device.h index ba917cfaefe6..73cb98040982 100644 --- a/arch/microblaze/include/asm/of_device.h +++ b/arch/microblaze/include/asm/of_device.h | |||
@@ -21,9 +21,8 @@ | |||
21 | * probed using OF properties. | 21 | * probed using OF properties. |
22 | */ | 22 | */ |
23 | struct of_device { | 23 | struct of_device { |
24 | struct device_node *node; /* to be obsoleted */ | ||
25 | u64 dma_mask; /* DMA mask */ | ||
26 | struct device dev; /* Generic device interface */ | 24 | struct device dev; /* Generic device interface */ |
25 | struct pdev_archdata archdata; | ||
27 | }; | 26 | }; |
28 | 27 | ||
29 | extern ssize_t of_device_get_modalias(struct of_device *ofdev, | 28 | extern ssize_t of_device_get_modalias(struct of_device *ofdev, |
diff --git a/arch/microblaze/include/asm/scatterlist.h b/arch/microblaze/include/asm/scatterlist.h index 35d786fe93ae..dc4a8900cc80 100644 --- a/arch/microblaze/include/asm/scatterlist.h +++ b/arch/microblaze/include/asm/scatterlist.h | |||
@@ -1 +1,3 @@ | |||
1 | #include <asm-generic/scatterlist.h> | 1 | #include <asm-generic/scatterlist.h> |
2 | |||
3 | #define ISA_DMA_THRESHOLD (~0UL) | ||
diff --git a/arch/microblaze/kernel/of_device.c b/arch/microblaze/kernel/of_device.c index 9a0f7632c47c..b372787886ed 100644 --- a/arch/microblaze/kernel/of_device.c +++ b/arch/microblaze/kernel/of_device.c | |||
@@ -12,7 +12,7 @@ | |||
12 | void of_device_make_bus_id(struct of_device *dev) | 12 | void of_device_make_bus_id(struct of_device *dev) |
13 | { | 13 | { |
14 | static atomic_t bus_no_reg_magic; | 14 | static atomic_t bus_no_reg_magic; |
15 | struct device_node *node = dev->node; | 15 | struct device_node *node = dev->dev.of_node; |
16 | const u32 *reg; | 16 | const u32 *reg; |
17 | u64 addr; | 17 | u64 addr; |
18 | int magic; | 18 | int magic; |
@@ -49,11 +49,10 @@ struct of_device *of_device_alloc(struct device_node *np, | |||
49 | if (!dev) | 49 | if (!dev) |
50 | return NULL; | 50 | return NULL; |
51 | 51 | ||
52 | dev->node = of_node_get(np); | 52 | dev->dev.of_node = of_node_get(np); |
53 | dev->dev.dma_mask = &dev->dma_mask; | 53 | dev->dev.dma_mask = &dev->archdata.dma_mask; |
54 | dev->dev.parent = parent; | 54 | dev->dev.parent = parent; |
55 | dev->dev.release = of_release_dev; | 55 | dev->dev.release = of_release_dev; |
56 | dev->dev.archdata.of_node = np; | ||
57 | 56 | ||
58 | if (bus_id) | 57 | if (bus_id) |
59 | dev_set_name(&dev->dev, bus_id); | 58 | dev_set_name(&dev->dev, bus_id); |
@@ -75,17 +74,17 @@ int of_device_uevent(struct device *dev, struct kobj_uevent_env *env) | |||
75 | 74 | ||
76 | ofdev = to_of_device(dev); | 75 | ofdev = to_of_device(dev); |
77 | 76 | ||
78 | if (add_uevent_var(env, "OF_NAME=%s", ofdev->node->name)) | 77 | if (add_uevent_var(env, "OF_NAME=%s", ofdev->dev.of_node->name)) |
79 | return -ENOMEM; | 78 | return -ENOMEM; |
80 | 79 | ||
81 | if (add_uevent_var(env, "OF_TYPE=%s", ofdev->node->type)) | 80 | if (add_uevent_var(env, "OF_TYPE=%s", ofdev->dev.of_node->type)) |
82 | return -ENOMEM; | 81 | return -ENOMEM; |
83 | 82 | ||
84 | /* Since the compatible field can contain pretty much anything | 83 | /* Since the compatible field can contain pretty much anything |
85 | * it's not really legal to split it out with commas. We split it | 84 | * it's not really legal to split it out with commas. We split it |
86 | * up using a number of environment variables instead. */ | 85 | * up using a number of environment variables instead. */ |
87 | 86 | ||
88 | compat = of_get_property(ofdev->node, "compatible", &cplen); | 87 | compat = of_get_property(ofdev->dev.of_node, "compatible", &cplen); |
89 | while (compat && *compat && cplen > 0) { | 88 | while (compat && *compat && cplen > 0) { |
90 | if (add_uevent_var(env, "OF_COMPATIBLE_%d=%s", seen, compat)) | 89 | if (add_uevent_var(env, "OF_COMPATIBLE_%d=%s", seen, compat)) |
91 | return -ENOMEM; | 90 | return -ENOMEM; |
diff --git a/arch/microblaze/kernel/of_platform.c b/arch/microblaze/kernel/of_platform.c index 0dc755286d38..ccf6f4257f4b 100644 --- a/arch/microblaze/kernel/of_platform.c +++ b/arch/microblaze/kernel/of_platform.c | |||
@@ -47,7 +47,7 @@ struct of_device *of_platform_device_create(struct device_node *np, | |||
47 | if (!dev) | 47 | if (!dev) |
48 | return NULL; | 48 | return NULL; |
49 | 49 | ||
50 | dev->dma_mask = 0xffffffffUL; | 50 | dev->archdata.dma_mask = 0xffffffffUL; |
51 | dev->dev.bus = &of_platform_bus_type; | 51 | dev->dev.bus = &of_platform_bus_type; |
52 | 52 | ||
53 | /* We do not fill the DMA ops for platform devices by default. | 53 | /* We do not fill the DMA ops for platform devices by default. |
@@ -166,7 +166,7 @@ EXPORT_SYMBOL(of_platform_bus_probe); | |||
166 | 166 | ||
167 | static int of_dev_node_match(struct device *dev, void *data) | 167 | static int of_dev_node_match(struct device *dev, void *data) |
168 | { | 168 | { |
169 | return to_of_device(dev)->node == data; | 169 | return to_of_device(dev)->dev.of_node == data; |
170 | } | 170 | } |
171 | 171 | ||
172 | struct of_device *of_find_device_by_node(struct device_node *np) | 172 | struct of_device *of_find_device_by_node(struct device_node *np) |
@@ -184,7 +184,7 @@ EXPORT_SYMBOL(of_find_device_by_node); | |||
184 | static int of_dev_phandle_match(struct device *dev, void *data) | 184 | static int of_dev_phandle_match(struct device *dev, void *data) |
185 | { | 185 | { |
186 | phandle *ph = data; | 186 | phandle *ph = data; |
187 | return to_of_device(dev)->node->phandle == *ph; | 187 | return to_of_device(dev)->dev.of_node->phandle == *ph; |
188 | } | 188 | } |
189 | 189 | ||
190 | struct of_device *of_find_device_by_phandle(phandle ph) | 190 | struct of_device *of_find_device_by_phandle(phandle ph) |