Changeset 7de5f12 in mainline for uspace/drv/char/msim-con/msim-con.c
- Timestamp:
- 2017-11-15T20:23:50Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6ac1243d, 7f4937e
- Parents:
- e7a8bd2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/char/msim-con/msim-con.c
re7a8bd2 r7de5f12 38 38 #include <errno.h> 39 39 #include <ipc/char.h> 40 #include <sysinfo.h>41 40 42 41 #include "msim-con.h" … … 84 83 85 84 /** Add msim console device. */ 86 int msim_con_add(msim_con_t *con )85 int msim_con_add(msim_con_t *con, msim_con_res_t *res) 87 86 { 88 87 ddf_fun_t *fun = NULL; 89 88 bool subscribed = false; 90 89 int rc; 90 91 con->res = *res; 91 92 92 93 fun = ddf_fun_create(con->dev, fun_exposed, "a"); … … 99 100 ddf_fun_set_conn_handler(fun, msim_con_connection); 100 101 101 sysarg_t paddr; 102 if (sysinfo_get_value("kbd.address.physical", &paddr) != EOK) { 103 rc = ENOENT; 104 goto error; 105 } 106 107 sysarg_t inr; 108 if (sysinfo_get_value("kbd.inr", &inr) != EOK) { 109 rc = ENOENT; 110 goto error; 111 } 112 113 msim_ranges[0].base = paddr; 114 msim_cmds[0].addr = (void *) paddr; 115 async_irq_subscribe(inr, msim_irq_handler, con, &msim_kbd); 102 msim_ranges[0].base = res->base; 103 msim_cmds[0].addr = (void *) res->base; 104 async_irq_subscribe(res->irq, msim_irq_handler, con, &msim_kbd); 116 105 subscribed = true; 117 106 … … 125 114 error: 126 115 if (subscribed) 127 async_irq_unsubscribe( inr);116 async_irq_unsubscribe(res->irq); 128 117 if (fun != NULL) 129 118 ddf_fun_destroy(fun);
Note:
See TracChangeset
for help on using the changeset viewer.