[PATCH v2] usb: gadget: at91_udc: dt: fix platform_data check

Fabio Porcedda fabio.porcedda at gmail.com
Tue Sep 11 22:07:47 EST 2012


Don't fail the initialization check for the platform_data
if there is avaiable an associated device tree node.

This patch fix the dt support introduced in 3.4-rc1 by commit
("d1494a3 USB: at91: Device udc add dt support").

Tested on a at91sam9260 based board (PRO3-EVK).

Signed-off-by: Fabio Porcedda <fabio.porcedda at gmail.com>
Cc: Stable <stable at vger.kernel.org> [v3.4+]
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
v2:
  - better description
  - add stable tag

 drivers/usb/gadget/at91_udc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 1e35963..660fd53 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -1699,7 +1699,7 @@ static int __devinit at91udc_probe(struct platform_device *pdev)
 	int		retval;
 	struct resource	*res;
 
-	if (!dev->platform_data) {
+	if (!dev->platform_data && !pdev->dev.of_node) {
 		/* small (so we copy it) but critical! */
 		DBG("missing platform_data\n");
 		return -ENODEV;
-- 
1.7.11.3



More information about the devicetree-discuss mailing list