Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/iicbus/iicoc.c
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
sc = device_get_softc(dev); | sc = device_get_softc(dev); | ||||
bus = device_get_unit(dev); | bus = device_get_unit(dev); | ||||
sc->dev = dev; | sc->dev = dev; | ||||
mtx_init(&sc->sc_mtx, "iicoc", "iicoc", MTX_DEF); | mtx_init(&sc->sc_mtx, "iicoc", "iicoc", MTX_DEF); | ||||
sc->mem_rid = 0; | sc->mem_rid = 0; | ||||
sc->mem_res = bus_alloc_resource(dev, | sc->mem_res = bus_alloc_resource(dev, | ||||
SYS_RES_MEMORY, &sc->mem_rid, 0ul, ~0ul, 0x100, RF_ACTIVE); | SYS_RES_MEMORY, &sc->mem_rid, 0, ~0, 0x100, RF_ACTIVE); | ||||
if (sc->mem_res == NULL) { | if (sc->mem_res == NULL) { | ||||
device_printf(dev, "Could not allocate bus resource.\n"); | device_printf(dev, "Could not allocate bus resource.\n"); | ||||
return (-1); | return (-1); | ||||
} | } | ||||
iicoc_init(dev); | iicoc_init(dev); | ||||
sc->iicbus = device_add_child(dev, "iicbus", -1); | sc->iicbus = device_add_child(dev, "iicbus", -1); | ||||
if (sc->iicbus == NULL) { | if (sc->iicbus == NULL) { | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |