Skip to content

Commit

Permalink
[SPARC] envctrl: implement ->unlocked_ioctl and ->compat_ioctl
Browse files Browse the repository at this point in the history
all the ioctls in the driver are 32bit compat clean and don't need BKL,
so we can switch it to ->unlocked_ioctl and ->compat_ioctl trivially.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Christoph Hellwig authored and David S. Miller committed Nov 7, 2005
1 parent 16cf0d8 commit 1928f8e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
10 changes: 0 additions & 10 deletions arch/sparc64/kernel/ioctl32.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,16 +474,6 @@ COMPATIBLE_IOCTL(FBIOGCURMAX)
/* Little v, the video4linux ioctls */
COMPATIBLE_IOCTL(_IOR('p', 20, int[7])) /* RTCGET */
COMPATIBLE_IOCTL(_IOW('p', 21, int[7])) /* RTCSET */
COMPATIBLE_IOCTL(ENVCTRL_RD_WARNING_TEMPERATURE)
COMPATIBLE_IOCTL(ENVCTRL_RD_SHUTDOWN_TEMPERATURE)
COMPATIBLE_IOCTL(ENVCTRL_RD_CPU_TEMPERATURE)
COMPATIBLE_IOCTL(ENVCTRL_RD_FAN_STATUS)
COMPATIBLE_IOCTL(ENVCTRL_RD_VOLTAGE_STATUS)
COMPATIBLE_IOCTL(ENVCTRL_RD_SCSI_TEMPERATURE)
COMPATIBLE_IOCTL(ENVCTRL_RD_ETHERNET_TEMPERATURE)
COMPATIBLE_IOCTL(ENVCTRL_RD_MTHRBD_TEMPERATURE)
COMPATIBLE_IOCTL(ENVCTRL_RD_CPU_VOLTAGE)
COMPATIBLE_IOCTL(ENVCTRL_RD_GLOBALADDRESS)
/* COMPATIBLE_IOCTL(D7SIOCRD) same value as ENVCTRL_RD_VOLTAGE_STATUS */
COMPATIBLE_IOCTL(D7SIOCWR)
COMPATIBLE_IOCTL(D7SIOCTM)
Expand Down
18 changes: 10 additions & 8 deletions drivers/sbus/char/envctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -654,9 +654,8 @@ envctrl_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
/* Function Description: Command what to read. Mapped to user ioctl().
* Return: Gives 0 for implemented commands, -EINVAL otherwise.
*/
static int
envctrl_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
static long
envctrl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
char __user *infobuf;

Expand Down Expand Up @@ -715,11 +714,14 @@ envctrl_release(struct inode *inode, struct file *file)
}

static struct file_operations envctrl_fops = {
.owner = THIS_MODULE,
.read = envctrl_read,
.ioctl = envctrl_ioctl,
.open = envctrl_open,
.release = envctrl_release,
.owner = THIS_MODULE,
.read = envctrl_read,
.unlocked_ioctl = envctrl_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = envctrl_ioctl,
#endif
.open = envctrl_open,
.release = envctrl_release,
};

static struct miscdevice envctrl_dev = {
Expand Down

0 comments on commit 1928f8e

Please sign in to comment.