Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Oct 2014 23:12:30 +0000 (UTC)
From:      Luiz Otavio O Souza <loos@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r273566 - head/sys/dev/gpio
Message-ID:  <201410232312.s9NNCUxU022378@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)



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