Skip to contentSkip to conversation

mfd: omap-usb-host: Drop support for non-DT probe

PATCH New Laurent Pinchart 1 participant 1 message Sep 12, 2018 USB

lore
Share & tools
lore
#0 lore raw

PATCH 3/3 mfd: omap-usb-host: Drop support for non-DT probe

Hi Roger,

Quoted 15 lines · On Wednesday, 12 September 2018 10:57:31 EEST Roger Quadros wrote:
Quoted 14 lines · Laurent Pinchart

Now that all platforms using OMAP USB host devices have been converted to DT, drop support for legacy non-DT probe from the driver.

---

 drivers/mfd/omap-usb-host.c            | 153 ++--------------------------
 include/linux/platform_data/usb-omap.h |   4 -
 2 files changed, 13 insertions(+), 144 deletions(-)
drivers/mfd/omap-usb-host.c +0 -0
index b731026541f5..ce28e0fda55e 100644

[snip]

Quoted 46 lines
Quoted 33 lines
drivers/mfd/omap-usb-host.c +9 -11
@@ -541,31 +424,28 @@ static const struct of_device_id
 usbhs_child_match_table[] = {
 static int usbhs_omap_probe(struct platform_device *pdev)
 {
 	struct device			*dev =  &pdev->dev;
-	struct usbhs_omap_platform_data	*pdata = dev_get_platdata(dev);
+	struct usbhs_omap_platform_data	*pdata;
 	struct usbhs_hcd_omap		*omap;
 	struct resource			*res;
 	int				ret = 0;
 	int				i;
 	bool				need_logic_fck;
 
-	dev_info(&pdev->dev, "%s\n", __func__);
-	if (dev->of_node) {
-		/* For DT boot we populate platform data from OF node */
-		pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
-		if (!pdata)
-			return -ENOMEM;
+	/* Populate platform data from OF node */
+	if (!dev->of_node) {
+		dev_err(dev, "Missing OF node\n");
+		return -ENODEV;
+	}
 
-		ret = usbhs_omap_get_dt_pdata(dev, pdata);
-		if (ret)
-			return ret;
+	pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
+	if (!pdata)
+		return -ENOMEM;
 
-		dev->platform_data = pdata;

drivers/mfd/omap-usb-host.c static const struct of_device_id · line 449

Quoted 10 lines
drivers/mfd/omap-usb-host.c +4 -5
-	}
+	ret = usbhs_omap_get_dt_pdata(dev, pdata);
+	if (ret)
+		return ret;
 
-	if (!pdata) {
-		dev_err(dev, "Missing platform data\n");
-		return -ENODEV;
-	}
+	dev->platform_data = pdata;

Do we still need to set dev->platform_data?

Quoted 3 lines

This driver can access it via

	struct usbhs_hcd_omap *omap = dev_get_drvdata(dev);
	omap->pdata;

Unfortunately we still do, as the ehci-omap driver accesses the omap-usb-host device platform data (through the ehci-omap device's parent).

Quoted 17 lines
Quoted 17 lines
drivers/mfd/omap-usb-host.c +0 -7
 	if (pdata->nports > OMAP3_HS_USB_PORTS) {
 		dev_info(dev, "Too many num_ports <%d> in platform_data. Max %d\n",
@@ -798,13 +678,6 @@ static int usbhs_omap_probe(struct platform_device
 *pdev)
 			goto err_mem;
 		}
-	} else {
-		ret = omap_usbhs_alloc_children(pdev);
-		if (ret) {
-			dev_err(dev, "omap_usbhs_alloc_children failed: %d\n",
-						ret);
-			goto err_mem;
-		}
 	}
 
 	return 0;

[snip]