Skip to contentSkip to conversation

usb: gadget: fsl: Set dma_ops for FSL USB Gadget Device

PATCH In review Suresh Gupta 2 participants 2 messages Mar 20, 2014 – Apr 17, 2014 USB

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 usb: gadget: fsl: Set dma_ops for FSL USB Gadget Device

From: Suresh Gupta <[email protected]>

DMA mapping functions are moved to common place in udc_core.c which expect the DMA operation of gadget device

---
Changes from previous version:
* Added description

 drivers/usb/gadget/fsl_udc_core.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/gadget/fsl_udc_core.c +1 -0
index d68aa77..35cb972 100644
@@ -2456,6 +2456,7 @@ static int __init fsl_udc_probe(struct platform_device *pdev)
 	/* Setup gadget.dev and register with kernel */
 	dev_set_name(&udc_controller->gadget.dev, "gadget");
 	udc_controller->gadget.dev.of_node = pdev->dev.of_node;
+	set_dma_ops(&udc_controller->gadget.dev, pdev->dev.archdata.dma_ops);
 
 	if (!IS_ERR_OR_NULL(udc_controller->transceiver))
 		udc_controller->gadget.is_otg = 1;
Signature · 1 line
1.8.4.1
#1 lore raw

Hi,

Quoted 18 lines · Suresh Gupta

From: Suresh Gupta <[email protected]>

DMA mapping functions are moved to common place in udc_core.c which expect the DMA operation of gadget device

---
Changes from previous version:
* Added description

 drivers/usb/gadget/fsl_udc_core.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/gadget/fsl_udc_core.c +0 -0
index d68aa77..35cb972 100644

drivers/usb/gadget/fsl_udc_core.c static int __init fsl_udc_probe(struct platform_device *pdev) · line 2459

Quoted 4 lines
drivers/usb/gadget/fsl_udc_core.c +1 -0
@@ -2456,6 +2456,7 @@ static int __init fsl_udc_probe(struct platform_device *pdev)
 	/* Setup gadget.dev and register with kernel */
 	dev_set_name(&udc_controller->gadget.dev, "gadget");
 	udc_controller->gadget.dev.of_node = pdev->dev.of_node;
+	set_dma_ops(&udc_controller->gadget.dev, pdev->dev.archdata.dma_ops);

I'm still not convinced this is the best thing to do in a driver. set_dma_ops() isn't even exposed on include/linux/ and no other driver tries to call it. This is really something that should be done at arch level.

Perhaps send a note to lakml and see if anybody has a better idea ?

cheers

Signature · 1 line
balbi