Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/stg/tmc18c30_subr.c
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | |||||
#define STG_HOSTID 7 | #define STG_HOSTID 7 | ||||
devclass_t stg_devclass; | devclass_t stg_devclass; | ||||
int | int | ||||
stg_alloc_resource(device_t dev) | stg_alloc_resource(device_t dev) | ||||
{ | { | ||||
struct stg_softc * sc = device_get_softc(dev); | struct stg_softc * sc = device_get_softc(dev); | ||||
u_long maddr, msize; | rman_res_t maddr, msize; | ||||
int error; | int error; | ||||
mtx_init(&sc->sc_sclow.sl_lock, "stg", NULL, MTX_DEF); | mtx_init(&sc->sc_sclow.sl_lock, "stg", NULL, MTX_DEF); | ||||
sc->port_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, | sc->port_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, | ||||
&sc->port_rid, RF_ACTIVE); | &sc->port_rid, RF_ACTIVE); | ||||
if (sc->port_res == NULL) { | if (sc->port_res == NULL) { | ||||
stg_release_resource(dev); | stg_release_resource(dev); | ||||
return(ENOMEM); | return(ENOMEM); | ||||
▲ Show 20 Lines • Show All 100 Lines • Show Last 20 Lines |