Changes in uspace/drv/intctl/obio/obio.c [c1694b6b:d0cbfd3] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/intctl/obio/obio.c
rc1694b6b rd0cbfd3 42 42 */ 43 43 44 #include <align.h> 45 #include <as.h> 44 46 #include <async.h> 45 47 #include <ddf/driver.h> … … 47 49 #include <ddi.h> 48 50 #include <errno.h> 49 #include <str_error.h>50 51 #include <inttypes.h> 51 52 #include <ipc/irc.h> … … 117 118 { 118 119 ddf_fun_t *fun_a = NULL; 120 int flags; 121 int retval; 119 122 int rc; 120 123 121 rc = pio_enable((void *)res->base, OBIO_SIZE, (void **) &obio->regs); 122 if (rc != EOK) { 124 flags = AS_AREA_READ | AS_AREA_WRITE; 125 obio->regs = (ioport64_t *)AS_AREA_ANY; 126 retval = physmem_map(res->base, 127 ALIGN_UP(OBIO_SIZE, PAGE_SIZE) >> PAGE_WIDTH, flags, 128 (void *) &obio->regs); 129 130 if (retval < 0) { 123 131 ddf_msg(LVL_ERROR, "Error mapping OBIO registers"); 124 132 rc = EIO; … … 126 134 } 127 135 128 ddf_msg(LVL_NOTE, "OBIO registers with base at 0x%" PRI xn, res->base);136 ddf_msg(LVL_NOTE, "OBIO registers with base at 0x%" PRIun, res->base); 129 137 130 138 fun_a = ddf_fun_create(obio->dev, fun_exposed, "a"); … … 139 147 rc = ddf_fun_bind(fun_a); 140 148 if (rc != EOK) { 141 ddf_msg(LVL_ERROR, "Failed binding function 'a' : %s", str_error(rc));149 ddf_msg(LVL_ERROR, "Failed binding function 'a'. (%d)", rc); 142 150 goto error; 143 151 }
Note:
See TracChangeset
for help on using the changeset viewer.