1 From 6d4c748e0470efac90e7dc4538ff3c5da51f0169 Mon Sep 17 00:00:00 2001
2 From: Shaun Ruffell <sruffell@sruffell.net>
3 Date: Mon, 16 Nov 2020 22:01:22 -0600
4 Subject: [PATCH 10/12] Remove checks for HAVE_UNLOCKED_IOCTL for kernel >= 5.9
6 In upstream commit (4e24566a134ea1674 "fs: remove the HAVE_UNLOCKED_IOCTL and
7 HAVE_COMPAT_IOCTL defines") [1] the kernel removed these defines.
9 All supported kernels include support for the unlocked_ioctl now, so
10 DAHDI can also remove these checks.
12 [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4e24566a134ea167441a1ffa3d439a27c
14 Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
16 drivers/dahdi/dahdi-base.c | 44 ---------------------------------
17 drivers/dahdi/dahdi_transcode.c | 11 ---------
18 2 files changed, 55 deletions(-)
20 --- a/drivers/dahdi/dahdi-base.c
21 +++ b/drivers/dahdi/dahdi-base.c
23 #include <linux/ktime.h>
24 #include <linux/slab.h>
26 -#if defined(HAVE_UNLOCKED_IOCTL) && defined(CONFIG_BKL)
27 -#include <linux/smp_lock.h>
30 #include <linux/ppp_defs.h>
32 #include <asm/atomic.h>
33 @@ -4069,14 +4065,6 @@ dahdi_timer_unlocked_ioctl(struct file *
37 -#ifndef HAVE_UNLOCKED_IOCTL
38 -static int dahdi_timer_ioctl(struct inode *inode, struct file *file,
39 - unsigned int cmd, unsigned long data)
41 - return dahdi_timer_unlocked_ioctl(file, cmd, data);
45 static int dahdi_ioctl_getgains(struct file *file, unsigned long data)
48 @@ -7011,14 +6999,6 @@ exit:
52 -#ifndef HAVE_UNLOCKED_IOCTL
53 -static int dahdi_ioctl(struct inode *inode, struct file *file,
54 - unsigned int cmd, unsigned long data)
56 - return dahdi_unlocked_ioctl(file, cmd, data);
61 * _get_next_channo - Return the next taken channel number from the span list.
62 * @span: The span with which to start the search.
63 @@ -10272,11 +10252,7 @@ static const struct file_operations dahd
66 .release = dahdi_release,
67 -#ifdef HAVE_UNLOCKED_IOCTL
68 .unlocked_ioctl = dahdi_unlocked_ioctl,
70 - .ioctl = dahdi_ioctl,
73 .read = dahdi_no_read,
74 .write = dahdi_no_write,
75 @@ -10285,11 +10261,7 @@ static const struct file_operations dahd
76 static const struct file_operations dahdi_timer_fops = {
78 .release = dahdi_timer_release,
79 -#ifdef HAVE_UNLOCKED_IOCTL
80 .unlocked_ioctl = dahdi_timer_unlocked_ioctl,
82 - .ioctl = dahdi_timer_ioctl,
84 .poll = dahdi_timer_poll,
85 .read = dahdi_no_read,
86 .write = dahdi_no_write,
87 @@ -10352,21 +10324,9 @@ nodev_unlocked_ioctl(struct file *file,
88 return nodev_common("ioctl");
91 -#ifndef HAVE_UNLOCKED_IOCTL
92 -static int nodev_ioctl(struct inode *inode, struct file *file,
93 - unsigned int cmd, unsigned long data)
95 - return nodev_unlocked_ioctl(file, cmd, data);
99 static const struct file_operations nodev_fops = {
100 .owner = THIS_MODULE,
101 -#ifdef HAVE_UNLOCKED_IOCTL
102 .unlocked_ioctl = nodev_unlocked_ioctl,
104 - .ioctl = nodev_ioctl,
106 .read = nodev_chan_read,
107 .write = nodev_chan_write,
108 .poll = nodev_chan_poll,
109 @@ -10376,11 +10336,7 @@ static const struct file_operations dahd
110 .owner = THIS_MODULE,
112 .release = dahdi_release,
113 -#ifdef HAVE_UNLOCKED_IOCTL
114 .unlocked_ioctl = dahdi_unlocked_ioctl,
116 - .ioctl = dahdi_ioctl,
118 .read = dahdi_chan_read,
119 .write = dahdi_chan_write,
120 .poll = dahdi_chan_poll,
121 --- a/drivers/dahdi/dahdi_transcode.c
122 +++ b/drivers/dahdi/dahdi_transcode.c
123 @@ -397,13 +397,6 @@ static long dahdi_tc_unlocked_ioctl(stru
127 -#ifndef HAVE_UNLOCKED_IOCTL
128 -static int dahdi_tc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long data)
130 - return (int)dahdi_tc_unlocked_ioctl(file, cmd, data);
134 static unsigned int dahdi_tc_poll(struct file *file, struct poll_table_struct *wait_table)
137 @@ -427,11 +420,7 @@ static struct file_operations __dahdi_tr
138 .owner = THIS_MODULE,
139 .open = dahdi_tc_open,
140 .release = dahdi_tc_release,
141 -#ifdef HAVE_UNLOCKED_IOCTL
142 .unlocked_ioctl = dahdi_tc_unlocked_ioctl,
144 - .ioctl = dahdi_tc_ioctl,
146 .read = dahdi_tc_read,
147 .write = dahdi_tc_write,
148 .poll = dahdi_tc_poll,