Skip to content

Commit 3b4df23

Browse files
Jiri Slaby (SUSE)gregkh
authored andcommitted
char/mwave: remove unneeded fops
file_operations::{read/write/open/release} need not be defined. The core code return proper values already (the same as the being removed ones). So there is no need to preserve these just for tracing via printk. Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Link: https://patch.msgid.link/20251119091949.825958-4-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 48e7786 commit 3b4df23

1 file changed

Lines changed: 0 additions & 62 deletions

File tree

drivers/char/mwave/mwavedd.c

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -86,40 +86,8 @@ module_param_hw(mwave_3780i_io, int, ioport, 0);
8686
module_param_hw(mwave_uart_irq, int, irq, 0);
8787
module_param_hw(mwave_uart_io, int, ioport, 0);
8888

89-
static int mwave_open(struct inode *inode, struct file *file);
90-
static int mwave_close(struct inode *inode, struct file *file);
91-
static long mwave_ioctl(struct file *filp, unsigned int iocmd,
92-
unsigned long ioarg);
93-
9489
MWAVE_DEVICE_DATA mwave_s_mdd;
9590

96-
static int mwave_open(struct inode *inode, struct file *file)
97-
{
98-
unsigned int retval = 0;
99-
100-
PRINTK_3(TRACE_MWAVE,
101-
"mwavedd::mwave_open, entry inode %p file %p\n",
102-
inode, file);
103-
PRINTK_2(TRACE_MWAVE,
104-
"mwavedd::mwave_open, exit return retval %x\n", retval);
105-
106-
return retval;
107-
}
108-
109-
static int mwave_close(struct inode *inode, struct file *file)
110-
{
111-
unsigned int retval = 0;
112-
113-
PRINTK_3(TRACE_MWAVE,
114-
"mwavedd::mwave_close, entry inode %p file %p\n",
115-
inode, file);
116-
117-
PRINTK_2(TRACE_MWAVE, "mwavedd::mwave_close, exit retval %x\n",
118-
retval);
119-
120-
return retval;
121-
}
122-
12391
static long mwave_ioctl(struct file *file, unsigned int iocmd,
12492
unsigned long ioarg)
12593
{
@@ -410,30 +378,6 @@ static long mwave_ioctl(struct file *file, unsigned int iocmd,
410378
return retval;
411379
}
412380

413-
414-
static ssize_t mwave_read(struct file *file, char __user *buf, size_t count,
415-
loff_t * ppos)
416-
{
417-
PRINTK_5(TRACE_MWAVE,
418-
"mwavedd::mwave_read entry file %p, buf %p, count %zx ppos %p\n",
419-
file, buf, count, ppos);
420-
421-
return -EINVAL;
422-
}
423-
424-
425-
static ssize_t mwave_write(struct file *file, const char __user *buf,
426-
size_t count, loff_t * ppos)
427-
{
428-
PRINTK_5(TRACE_MWAVE,
429-
"mwavedd::mwave_write entry file %p, buf %p,"
430-
" count %zx ppos %p\n",
431-
file, buf, count, ppos);
432-
433-
return -EINVAL;
434-
}
435-
436-
437381
static int register_serial_portandirq(unsigned int port, int irq)
438382
{
439383
struct uart_8250_port uart;
@@ -478,18 +422,12 @@ static int register_serial_portandirq(unsigned int port, int irq)
478422
return serial8250_register_8250_port(&uart);
479423
}
480424

481-
482425
static const struct file_operations mwave_fops = {
483426
.owner = THIS_MODULE,
484-
.read = mwave_read,
485-
.write = mwave_write,
486427
.unlocked_ioctl = mwave_ioctl,
487-
.open = mwave_open,
488-
.release = mwave_close,
489428
.llseek = default_llseek,
490429
};
491430

492-
493431
static struct miscdevice mwave_misc_dev = { MWAVE_MINOR, "mwave", &mwave_fops };
494432

495433
/*

0 commit comments

Comments
 (0)