Changes in uspace/drv/char/ns8250/ns8250.c [09ab0a9a:f2d88f3] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/char/ns8250/ns8250.c
r09ab0a9a rf2d88f3 246 246 * @param count The number of bytes to be read. 247 247 * @param nread Place to store number of bytes actually read 248 * @param flags @c chardev_f_nonblock not to block waiting for data 249 * even if no data is available 248 250 * 249 251 * @return EOK on success or non-zero error code 250 252 */ 251 static errno_t ns8250_read(chardev_srv_t *srv, void *buf, size_t count, size_t *nread) 253 static errno_t ns8250_read(chardev_srv_t *srv, void *buf, size_t count, size_t *nread, 254 chardev_flags_t flags) 252 255 { 253 256 ns8250_t *ns = srv_ns8250(srv); … … 261 264 262 265 fibril_mutex_lock(&ns->mutex); 263 while (buf_is_empty(&ns->input_buffer)) 266 while ((flags & chardev_f_none) == 0 && 267 buf_is_empty(&ns->input_buffer)) 264 268 fibril_condvar_wait(&ns->input_buffer_available, &ns->mutex); 265 269 while (!buf_is_empty(&ns->input_buffer) && pos < count) { … … 829 833 bool need_cleanup = false; 830 834 bool need_unreg_intr_handler = false; 835 bool bound = false; 831 836 errno_t rc; 832 837 … … 909 914 } 910 915 916 bound = true; 911 917 ns->fun = fun; 912 918 913 ddf_fun_add_to_category(fun, "serial"); 919 rc = ddf_fun_add_to_category(fun, "serial"); 920 if (rc != EOK) { 921 ddf_msg(LVL_ERROR, "Error adding function to category 'serial'."); 922 goto fail; 923 } 914 924 915 925 ddf_msg(LVL_NOTE, "Device %s successfully initialized.", … … 918 928 return EOK; 919 929 fail: 930 if (bound) 931 ddf_fun_unbind(fun); 920 932 if (fun != NULL) 921 933 ddf_fun_destroy(fun);
Note:
See TracChangeset
for help on using the changeset viewer.