Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Mar 2017 01:30:18 +0000 (UTC)
From:      Justin Hibbits <jhibbits@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r315879 - head/sys/powerpc/mpc85xx
Message-ID:  <201703240130.v2O1UIA5018845@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhibbits
Date: Fri Mar 24 01:30:18 2017
New Revision: 315879
URL: https://svnweb.freebsd.org/changeset/base/315879

Log:
  Switch qoriq_gpio over to using ofw_bus_search_compatible
  
  This will make it easier to add more compatibility strings in the future, if
  necessary.

Modified:
  head/sys/powerpc/mpc85xx/qoriq_gpio.c

Modified: head/sys/powerpc/mpc85xx/qoriq_gpio.c
==============================================================================
--- head/sys/powerpc/mpc85xx/qoriq_gpio.c	Fri Mar 24 01:23:07 2017	(r315878)
+++ head/sys/powerpc/mpc85xx/qoriq_gpio.c	Fri Mar 24 01:30:18 2017	(r315879)
@@ -215,13 +215,18 @@ qoriq_gpio_pin_toggle(device_t dev, uint
 	return (0);
 }
 
+static struct ofw_compat_data gpio_matches[] = {
+    {"fsl,qoriq-gpio", 1},
+    {"fsl,pq3-gpio", 1},
+    {"fsl,mpc8572-gpio", 1},
+    {0, 0}
+};
+
 static int
 qoriq_gpio_probe(device_t dev)
 {
 
-	if (!ofw_bus_is_compatible(dev, "fsl,qoriq-gpio") &&
-	    !ofw_bus_is_compatible(dev, "fsl,pq3-gpio") &&
-	    !ofw_bus_is_compatible(dev, "fsl,mpc8572-gpio"))
+	if (ofw_bus_search_compatible(dev, gpio_matches)->ocd_data == 0)
 		return (ENXIO);
 
 	device_set_desc(dev, "Freescale QorIQ GPIO driver");



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