Re: [PATCH 28/28] usb: musb: fallback to static method if only one type of DMA is defined

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

On 13-12-2010 15:48, Ming Lei wrote:

On 12-12-2010 20:02, tom.leiming@xxxxxxxxx wrote:

From: Ming Lei<tom.leiming@xxxxxxxxx>

If only one DMA type for musb is defined, we always use
this DMA type.

Signed-off-by: Ming Lei<tom.leiming@xxxxxxxxx>

[...]

diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index 97b9760..e233678 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -695,20 +695,31 @@ static inline const char *get_dma_name(struct musb
*musb)
  }

  #ifdef CONFIG_USB_INVENTRA_DMA
+#if !defined(CONFIG_USB_TI_CPPI_DMA)&&
!defined(CONFIG_USB_TUSB_OMAP_DMA)
+#define        is_inventra_dma(musb)   1
+#else
  #define       is_inventra_dma(musb)   (musb->ops->flags&
MUSB_GLUE_DMA_INVENTRA)
+#endif
  #else
  #define       is_inventra_dma(musb)   0
  #endif

  #ifdef CONFIG_USB_TI_CPPI_DMA
+#if !defined(CONFIG_USB_INVENTRA_DMA)&&
!defined(CONFIG_USB_TUSB_OMAP_DMA)
+#define        is_cppi_enabled(musb)   1
+#else
  #define       is_cppi_enabled(musb)   (musb->ops->flags&
MUSB_GLUE_DMA_CPPI)
-
+#endif
  #else
  #define       is_cppi_enabled(musb)   0
  #endif

  #ifdef CONFIG_USB_TUSB_OMAP_DMA
+#if !defined(CONFIG_USB_INVENTRA_DMA)&&  !defined(CONFIG_USB_TI_CPPI_DMA)
+#define tusb_dma_omap(musb)                    1
+#else
  #define tusb_dma_omap(musb)                   (musb->ops->flags&
MUSB_GLUE_DMA_TUSB)
+#endif
  #else
  #define tusb_dma_omap(musb)                   0
  #endif

   This doesn't really scale.

Sorry, could you explain it in more detail so that I can grasp your idea?

The #if's will have to grow each time the new DMA engine is added. In fact, I don't see why this patch is even necessary.

thanks,

WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux