1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-25 11:37:56 +00:00

Provide a working GPIOBUS_IVAR() macro for FDT systems.

This commit is contained in:
Luiz Otavio O Souza 2014-10-23 23:12:30 +00:00
parent b0d69dfad9
commit b09d4398fa
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=273566

View File

@ -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)