diff options
author | Michal Simek <michal.simek@xilinx.com> | 2014-05-16 06:56:53 -0400 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2014-06-04 00:59:55 -0400 |
commit | 3b3b6853bc9502282e7f53c117a18f20f0581fd9 (patch) | |
tree | dde2c9b49fdd4e28df0d99adc8d29711aa87d0d6 /arch | |
parent | a44e437ac63184aaeb7cd8f76fb8907c75842f29 (diff) |
microblaze: Return default dma operations
Return Microblaze default dma operations
and remove bus notifier which setups the same dma operations
by default when device is added to the system.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/microblaze/include/asm/dma-mapping.h | 14 | ||||
-rw-r--r-- | arch/microblaze/kernel/setup.c | 28 |
2 files changed, 3 insertions, 39 deletions
diff --git a/arch/microblaze/include/asm/dma-mapping.h b/arch/microblaze/include/asm/dma-mapping.h index 46460f1c49c4..cf8056011a0a 100644 --- a/arch/microblaze/include/asm/dma-mapping.h +++ b/arch/microblaze/include/asm/dma-mapping.h | |||
@@ -43,8 +43,6 @@ static inline unsigned long device_to_mask(struct device *dev) | |||
43 | return 0xfffffffful; | 43 | return 0xfffffffful; |
44 | } | 44 | } |
45 | 45 | ||
46 | extern struct dma_map_ops *dma_ops; | ||
47 | |||
48 | /* | 46 | /* |
49 | * Available generic sets of operations | 47 | * Available generic sets of operations |
50 | */ | 48 | */ |
@@ -52,15 +50,9 @@ extern struct dma_map_ops dma_direct_ops; | |||
52 | 50 | ||
53 | static inline struct dma_map_ops *get_dma_ops(struct device *dev) | 51 | static inline struct dma_map_ops *get_dma_ops(struct device *dev) |
54 | { | 52 | { |
55 | /* We don't handle the NULL dev case for ISA for now. We could | 53 | if (dev && dev->archdata.dma_ops) |
56 | * do it via an out of line call but it is not needed for now. The | 54 | return dev->archdata.dma_ops; |
57 | * only ISA DMA device we support is the floppy and we have a hack | 55 | return &dma_direct_ops; |
58 | * in the floppy driver directly to get a device for us. | ||
59 | */ | ||
60 | if (unlikely(!dev) || !dev->archdata.dma_ops) | ||
61 | return NULL; | ||
62 | |||
63 | return dev->archdata.dma_ops; | ||
64 | } | 56 | } |
65 | 57 | ||
66 | static inline void set_dma_ops(struct device *dev, struct dma_map_ops *ops) | 58 | static inline void set_dma_ops(struct device *dev, struct dma_map_ops *ops) |
diff --git a/arch/microblaze/kernel/setup.c b/arch/microblaze/kernel/setup.c index 67cc4b282cc1..ef011295777f 100644 --- a/arch/microblaze/kernel/setup.c +++ b/arch/microblaze/kernel/setup.c | |||
@@ -229,31 +229,3 @@ static int __init debugfs_tlb(void) | |||
229 | device_initcall(debugfs_tlb); | 229 | device_initcall(debugfs_tlb); |
230 | # endif | 230 | # endif |
231 | #endif | 231 | #endif |
232 | |||
233 | static int dflt_bus_notify(struct notifier_block *nb, | ||
234 | unsigned long action, void *data) | ||
235 | { | ||
236 | struct device *dev = data; | ||
237 | |||
238 | /* We are only intereted in device addition */ | ||
239 | if (action != BUS_NOTIFY_ADD_DEVICE) | ||
240 | return 0; | ||
241 | |||
242 | set_dma_ops(dev, &dma_direct_ops); | ||
243 | |||
244 | return NOTIFY_DONE; | ||
245 | } | ||
246 | |||
247 | static struct notifier_block dflt_plat_bus_notifier = { | ||
248 | .notifier_call = dflt_bus_notify, | ||
249 | .priority = INT_MAX, | ||
250 | }; | ||
251 | |||
252 | static int __init setup_bus_notifier(void) | ||
253 | { | ||
254 | bus_register_notifier(&platform_bus_type, &dflt_plat_bus_notifier); | ||
255 | |||
256 | return 0; | ||
257 | } | ||
258 | |||
259 | arch_initcall(setup_bus_notifier); | ||