Author: loos
Date: Thu Oct 23 23:12:30 2014
New Revision: 273566
URL: https://svnweb.freebsd.org/changeset/base/273566

Log:
  Provide a working GPIOBUS_IVAR() macro for FDT systems.

Modified:
  head/sys/dev/gpio/gpiobusvar.h

Modified: head/sys/dev/gpio/gpiobusvar.h
==============================================================================
--- head/sys/dev/gpio/gpiobusvar.h      Thu Oct 23 23:11:04 2014        
(r273565)
+++ head/sys/dev/gpio/gpiobusvar.h      Thu Oct 23 23:12:30 2014        
(r273566)
@@ -41,7 +41,12 @@
 
 #include "gpio_if.h"
 
+#ifdef FDT
+#define        GPIOBUS_IVAR(d) (struct gpiobus_ivar *)                         
\
+       &((struct ofw_gpiobus_devinfo *)device_get_ivars(d))->opd_dinfo
+#else
 #define        GPIOBUS_IVAR(d) (struct gpiobus_ivar *) device_get_ivars(d)
+#endif
 #define        GPIOBUS_SOFTC(d) (struct gpiobus_softc *) device_get_softc(d)
 #define        GPIOBUS_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx)
 #define        GPIOBUS_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx)
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to