Skip to content

Commit b288f13

Browse files
committed
Switch Sibyte profiling driver to ->compat_ioctl
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent ea3d710 commit b288f13

2 files changed

Lines changed: 8 additions & 11 deletions

File tree

‎arch/mips/kernel/ioctl32.c‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,6 @@ IOCTL_TABLE_START
4141
#define DECLARES
4242
#include "compat_ioctl.c"
4343

44-
#ifdef CONFIG_SIBYTE_TBPROF
45-
COMPATIBLE_IOCTL(SBPROF_ZBSTART)
46-
COMPATIBLE_IOCTL(SBPROF_ZBSTOP)
47-
COMPATIBLE_IOCTL(SBPROF_ZBWAITFULL)
48-
#endif /* CONFIG_SIBYTE_TBPROF */
49-
5044
/*HANDLE_IOCTL(RTC_IRQP_READ, w_long)
5145
COMPATIBLE_IOCTL(RTC_IRQP_SET)
5246
HANDLE_IOCTL(RTC_EPOCH_READ, w_long)

‎arch/mips/sibyte/sb1250/bcm1250_tbprof.c‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <linux/fs.h>
2929
#include <linux/errno.h>
3030
#include <linux/reboot.h>
31+
#include <linux/smp_lock.h>
3132
#include <linux/wait.h>
3233
#include <asm/uaccess.h>
3334
#include <asm/io.h>
@@ -343,13 +344,13 @@ static ssize_t sbprof_tb_read(struct file *filp, char *buf,
343344
return count;
344345
}
345346

346-
static int sbprof_tb_ioctl(struct inode *inode,
347-
struct file *filp,
348-
unsigned int command,
349-
unsigned long arg)
347+
static long sbprof_tb_ioctl(struct file *filp,
348+
unsigned int command,
349+
unsigned long arg)
350350
{
351351
int error = 0;
352352

353+
lock_kernel();
353354
switch (command) {
354355
case SBPROF_ZBSTART:
355356
error = sbprof_zbprof_start(filp);
@@ -368,6 +369,7 @@ static int sbprof_tb_ioctl(struct inode *inode,
368369
error = -EINVAL;
369370
break;
370371
}
372+
unlock_kernel();
371373

372374
return error;
373375
}
@@ -377,7 +379,8 @@ static struct file_operations sbprof_tb_fops = {
377379
.open = sbprof_tb_open,
378380
.release = sbprof_tb_release,
379381
.read = sbprof_tb_read,
380-
.ioctl = sbprof_tb_ioctl,
382+
.unlocked_ioctl = sbprof_tb_ioctl,
383+
.compat_ioctl = sbprof_tb_ioctl,
381384
.mmap = NULL,
382385
};
383386

0 commit comments

Comments
 (0)