STYLE_CLONE, STYLE_CLONE_A };
#define IS_DEV_STYLE(s) (s>=STYLE_NDEV && s<=STYLE_CLONE_A)
+#define dev_style_asyn(devstyle) ((devstyle) == STYLE_DEVA || \
+ (devstyle) == STYLE_CLONE_A)
+
/*===========================================================================*
* Major and minor device numbers *
*===========================================================================*/
if (major >= NR_DEVICES) /* Device endpoint not found; nothing to do */
return;
- if (dmap[major].dmap_style == STYLE_DEVA ||
- dmap[major].dmap_style == STYLE_CLONE_A) {
+ if (dev_style_asyn(dmap[major].dmap_style)) {
printf("VFS: not doing dev_status for async driver %d\n", m->m_source);
return;
}
/* Task has completed. See if call completed. */
if (ret == SUSPEND) {
- if ((flags & O_NONBLOCK) && !(dp->dmap_style == STYLE_DEVA ||
- dp->dmap_style == STYLE_CLONE_A)) {
+ if ((flags & O_NONBLOCK) && !dev_style_asyn(dp->dmap_style)) {
/* Not supposed to block. */
ret = cancel_nblock(dp, minor_dev, call_nr, ioproc, gid);
if (ret == EINTR)
r = (*dp->dmap_io)(dp->dmap_driver, &dev_mess);
if (r != OK) return(r);
- if (op == DEV_OPEN && dp->dmap_style == STYLE_CLONE_A) {
+ if (op == DEV_OPEN && dev_style_asyn(dp->dmap_style)) {
/* Wait for reply when driver is asynchronous */
fp->fp_task = dp->dmap_driver;
worker_wait();