static long zpios_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { unsigned int minor = iminor(file->f_dentry->d_inode); int rc = 0; /* Ignore tty ioctls */ if ((cmd & 0xffffff00) == ((int)'T') << 8) return -ENOTTY; if (minor >= ZPIOS_MINORS) return -ENXIO; switch (cmd) { case ZPIOS_CFG: rc = zpios_ioctl_cfg(file, arg); break; case ZPIOS_CMD: rc = zpios_ioctl_cmd(file, arg); break; default: zpios_print(file, "Bad ioctl command %d\n", cmd); rc = -EINVAL; break; } return rc; }
static long zpios_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { int rc = 0; /* Ignore tty ioctls */ if ((cmd & 0xffffff00) == ((int)'T') << 8) return (-ENOTTY); switch (cmd) { case ZPIOS_CFG: rc = zpios_ioctl_cfg(file, arg); break; case ZPIOS_CMD: rc = zpios_ioctl_cmd(file, arg); break; default: zpios_print(file, "Bad ioctl command %d\n", cmd); rc = -EINVAL; break; } return (rc); }