On 12/18/2014 9:53 PM, Mian Yousaf Kaukab wrote:
From: Gregory Herrero <[email protected]>
* Add an of specific function to parse device node properties.
* Enable dma usage only if device tree property 'g_use_dma' is present.
Hyphen is preferred to underscore in the device tree prop names.
Signed-off-by: Gregory Herrero <[email protected]>
[...]
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 58699c3..eb58305 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
[...]
@@ -3402,6 +3402,24 @@ static void s3c_hsotg_delete_debug(struct dwc2_hsotg
*hsotg)
debugfs_remove(hsotg->debug_root);
}
+#ifdef CONFIG_OF
+static int s3c_hsotg_of_probe(struct dwc2_hsotg *hsotg)
+{
+ struct device_node *np = hsotg->dev->of_node;
+
+ /* Enable dma if requested in device tree */
+ if (of_find_property(np, "g_use_dma", NULL))
Use of_propery_read_bool() please.
+ hsotg->g_using_dma = true;
+
+ return 0;
The function always returns 0, why not make it *void* for now?
[...]
@@ -3421,6 +3439,10 @@ int dwc2_gadget_init(struct dwc2_hsotg *hsotg, int irq)
/* Set default UTMI width */
hsotg->phyif = GUSBCFG_PHYIF16;
+ ret = s3c_hsotg_of_probe(hsotg);
+ if (ret)
+ return ret;
Dead code as s3c_hsotg_of_probe() always returns 0.
[...]
WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html