[PATCH 049/100] usb: dwc3: omap: bail out early on non-DT boot

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

 



OMAP5 won't support non-DT boot, so instead of:

if (node)
	foo();

return 0;

which returns zero even on non-DT boot, we have
to bail out early if node isn't a valid pointer:

if (!node)
	return -ENODEV;

foo();

return 0;

Signed-off-by: Felipe Balbi <balbi@xxxxxx>
---
 drivers/usb/dwc3/dwc3-omap.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index f340023..2a56b93 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -352,6 +352,11 @@ static int dwc3_omap_probe(struct platform_device *pdev)
 
 	void __iomem		*base;
 
+	if (!node) {
+		dev_err(dev, "missing OF node\n");
+		return -ENODEV;
+	}
+
 	omap = devm_kzalloc(dev, sizeof(*omap), GFP_KERNEL);
 	if (!omap) {
 		dev_err(dev, "not enough memory\n");
@@ -442,13 +447,10 @@ static int dwc3_omap_probe(struct platform_device *pdev)
 
 	dwc3_omap_enable_irqs(omap);
 
-	if (node) {
-		ret = of_platform_populate(node, NULL, NULL, dev);
-		if (ret) {
-			dev_err(&pdev->dev,
-				"failed to add create dwc3 core\n");
-			return ret;
-		}
+	ret = of_platform_populate(node, NULL, NULL, dev);
+	if (ret) {
+		dev_err(dev, "failed to add create dwc3 core\n");
+		return ret;
 	}
 
 	return 0;
-- 
1.8.1.rc1.5.g7e0651a

--
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