Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Nov 2016 13:11:03 +0000 (UTC)
From:      Olivier Houchard <cognet@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r308828 - head/sys/arm/ti/usb
Message-ID:  <201611191311.uAJDB3h9065597@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cognet
Date: Sat Nov 19 13:11:03 2016
New Revision: 308828
URL: https://svnweb.freebsd.org/changeset/base/308828

Log:
  Move the pandaboard initialization from the probe to the attach method.
  Use ofw_bus_node_is_compatible instead of fdt_is_compatible, as the
  later is deprecated.
  
  Suggested by:	andrew

Modified:
  head/sys/arm/ti/usb/omap_ehci.c

Modified: head/sys/arm/ti/usb/omap_ehci.c
==============================================================================
--- head/sys/arm/ti/usb/omap_ehci.c	Sat Nov 19 08:54:21 2016	(r308827)
+++ head/sys/arm/ti/usb/omap_ehci.c	Sat Nov 19 13:11:03 2016	(r308828)
@@ -261,24 +261,12 @@ omap_ehci_init(struct omap_ehci_softc *i
 static int
 omap_ehci_probe(device_t dev)
 {
-	phandle_t root;
-
 	if (!ofw_bus_status_okay(dev))
 		return (ENXIO);
 
 	if (!ofw_bus_is_compatible(dev, "ti,ehci-omap"))
 		return (ENXIO);
 
-#ifdef SOC_OMAP4
-	/* 
-	 * If we're running a Pandaboard, run Pandaboard-specific 
-	 * init code.
-	 */
-	root = OF_finddevice("/");
-	if (fdt_is_compatible(root, "ti,omap4-panda"))
-		pandaboard_usb_hub_init();
-#endif
-
 	device_set_desc(dev, OMAP_EHCI_HC_DEVSTR);
 	
 	return (BUS_PROBE_DEFAULT);
@@ -303,9 +291,22 @@ omap_ehci_attach(device_t dev)
 {
 	struct omap_ehci_softc *isc = device_get_softc(dev);
 	ehci_softc_t *sc = &isc->base;
+#ifdef SOC_OMAP4
+	phandle_t root;
+#endif
 	int err;
 	int rid;
 
+#ifdef SOC_OMAP4
+	/* 
+	 * If we're running a Pandaboard, run Pandaboard-specific 
+	 * init code.
+	 */
+	root = OF_finddevice("/");
+	if (ofw_bus_node_is_compatible(root, "ti,omap4-panda"))
+		pandaboard_usb_hub_init();
+#endif
+
 	/* initialise some bus fields */
 	sc->sc_bus.parent = dev;
 	sc->sc_bus.devices = sc->sc_devices;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611191311.uAJDB3h9065597>