Author: ian
Date: Thu May 23 15:47:30 2019
New Revision: 348169
URL: https://svnweb.freebsd.org/changeset/base/348169

Log:
  Define macros making it easier to define bus-specific pnpinfo for FDT systems.
  
  Pnpinfo is bus-specific and requires the bus name. The FDTCOMPAT_PNP_INFO()
  macro makes it easier to define new FDT-based pnpinfo for busses other than
  simplebus.
  
  Differential Revision:        https://reviews.freebsd.org/D20382

Modified:
  head/sys/dev/iicbus/iicbus.h
  head/sys/dev/ofw/ofw_bus_subr.h

Modified: head/sys/dev/iicbus/iicbus.h
==============================================================================
--- head/sys/dev/iicbus/iicbus.h        Thu May 23 15:00:15 2019        
(r348168)
+++ head/sys/dev/iicbus/iicbus.h        Thu May 23 15:47:30 2019        
(r348169)
@@ -72,6 +72,12 @@ IICBUS_ACCESSOR(nostop,              NOSTOP,         bool)
 #define        IICBUS_UNLOCK(sc)               mtx_unlock(&(sc)->lock)
 #define        IICBUS_ASSERT_LOCKED(sc)        mtx_assert(&(sc)->lock, 
MA_OWNED)
 
+#ifdef FDT
+#define        IICBUS_FDT_PNPINFO(t)   FDTCOMPAT_PNP_INFO(t, iicbus)
+#else
+#define        IICBUS_FDT_PNPINFO(t)
+#endif
+
 int  iicbus_generic_intr(device_t dev, int event, char *buf);
 void iicbus_init_frequency(device_t dev, u_int bus_freq);
 

Modified: head/sys/dev/ofw/ofw_bus_subr.h
==============================================================================
--- head/sys/dev/ofw/ofw_bus_subr.h     Thu May 23 15:00:15 2019        
(r348168)
+++ head/sys/dev/ofw/ofw_bus_subr.h     Thu May 23 15:47:30 2019        
(r348169)
@@ -65,9 +65,11 @@ struct intr_map_data_fdt {
 };
 #endif
 
-#define SIMPLEBUS_PNP_DESCR "Z:compat;P:#;"
-#define SIMPLEBUS_PNP_INFO(t) \
-       MODULE_PNP_INFO(SIMPLEBUS_PNP_DESCR, simplebus, t, t, sizeof(t) / 
sizeof(t[0]));
+#define FDTCOMPAT_PNP_DESCR "Z:compat;P:#;"
+#define FDTCOMPAT_PNP_INFO(t, busname) \
+       MODULE_PNP_INFO(FDTCOMPAT_PNP_DESCR, busname, t, t, sizeof(t) / 
sizeof(t[0]));
+
+#define SIMPLEBUS_PNP_INFO(t) FDTCOMPAT_PNP_INFO(t, simplebus)
 
 /* Generic implementation of ofw_bus_if.m methods and helper routines */
 int    ofw_bus_gen_setup_devinfo(struct ofw_bus_devinfo *, phandle_t);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to