From b09d4398fa6039e3631b667f5baf4dcc0f3a303e Mon Sep 17 00:00:00 2001 From: Luiz Otavio O Souza Date: Thu, 23 Oct 2014 23:12:30 +0000 Subject: [PATCH] Provide a working GPIOBUS_IVAR() macro for FDT systems. --- sys/dev/gpio/gpiobusvar.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/gpio/gpiobusvar.h b/sys/dev/gpio/gpiobusvar.h index e2ee51bd6f0c..08e9760f47a6 100644 --- a/sys/dev/gpio/gpiobusvar.h +++ b/sys/dev/gpio/gpiobusvar.h @@ -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)