microblaze: Return default dma operations
authorMichal Simek <michal.simek@xilinx.com>
Fri, 16 May 2014 10:56:53 +0000 (12:56 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 4 Jun 2014 04:59:55 +0000 (06:59 +0200)
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>
arch/microblaze/include/asm/dma-mapping.h
arch/microblaze/kernel/setup.c

index 46460f1..cf80560 100644 (file)
@@ -43,8 +43,6 @@ static inline unsigned long device_to_mask(struct device *dev)
        return 0xfffffffful;
 }
 
-extern struct dma_map_ops *dma_ops;
-
 /*
  * Available generic sets of operations
  */
@@ -52,15 +50,9 @@ extern struct dma_map_ops dma_direct_ops;
 
 static inline struct dma_map_ops *get_dma_ops(struct device *dev)
 {
-       /* We don't handle the NULL dev case for ISA for now. We could
-        * do it via an out of line call but it is not needed for now. The
-        * only ISA DMA device we support is the floppy and we have a hack
-        * in the floppy driver directly to get a device for us.
-        */
-       if (unlikely(!dev) || !dev->archdata.dma_ops)
-               return NULL;
-
-       return dev->archdata.dma_ops;
+       if (dev && dev->archdata.dma_ops)
+               return dev->archdata.dma_ops;
+       return &dma_direct_ops;
 }
 
 static inline void set_dma_ops(struct device *dev, struct dma_map_ops *ops)
index 67cc4b2..ef01129 100644 (file)
@@ -229,31 +229,3 @@ static int __init debugfs_tlb(void)
 device_initcall(debugfs_tlb);
 # endif
 #endif
-
-static int dflt_bus_notify(struct notifier_block *nb,
-                               unsigned long action, void *data)
-{
-       struct device *dev = data;
-
-       /* We are only intereted in device addition */
-       if (action != BUS_NOTIFY_ADD_DEVICE)
-               return 0;
-
-       set_dma_ops(dev, &dma_direct_ops);
-
-       return NOTIFY_DONE;
-}
-
-static struct notifier_block dflt_plat_bus_notifier = {
-       .notifier_call = dflt_bus_notify,
-       .priority = INT_MAX,
-};
-
-static int __init setup_bus_notifier(void)
-{
-       bus_register_notifier(&platform_bus_type, &dflt_plat_bus_notifier);
-
-       return 0;
-}
-
-arch_initcall(setup_bus_notifier);