Skip to contentSkip to conversation

cobalt/drivers: Ensure bidirectional IOCTL migration

PATCH New Jan Kiszka 1 participant 1 message Sep 23, 2019

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 cobalt/drivers: Ensure bidirectional IOCTL migration

From: Jan Kiszka <[email protected]>

Ensure that IOCTL switch-over is also prepared for the NRT-to-RT path. While we didn't need this in practice for the changed drivers, it's better to have this enabled in case driver developers derive from this pattern.

---
 kernel/drivers/autotune/autotune.c  | 2 +-
 kernel/drivers/testing/switchtest.c | 2 +-
 kernel/drivers/testing/timerbench.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
kernel/drivers/autotune/autotune.c +1 -1
index 469e628691..d9208f2a89 100644
@@ -665,7 +665,7 @@ static int autotune_ioctl_nrt(struct rtdm_fd *fd, unsigned int request, void *ar
 		tuner = &uthread_tuner.tuner;
 		break;
 	default:
-		return -EINVAL;
+		return -ENOSYS;
 	}
 
 	ret = rtdm_copy_from_user(fd, &setup, arg, sizeof(setup));
kernel/drivers/testing/switchtest.c +1 -1
index d955c2b65f..8224974e5c 100644
@@ -667,7 +667,7 @@ static int rtswitch_ioctl_nrt(struct rtdm_fd *fd,
 		return 0;
 
 	default:
-		return -ENOTTY;
+		return -ENOSYS;
 	}
 }
 
kernel/drivers/testing/timerbench.c +1 -1
index 1b4c413b7e..8b91bae9b2 100644
@@ -453,7 +453,7 @@ static int rt_tmbench_ioctl_nrt(struct rtdm_fd *fd,
 		err = rt_tmbench_stop(ctx, arg);
 		break;
 	default:
-		err = -EINVAL;
+		err = -ENOSYS;
 	}
 
 	return err;
Signature · 1 line
2.16.4