Commit 3b4df232 authored by Jiri Slaby (SUSE)'s avatar Jiri Slaby (SUSE) Committed by Greg Kroah-Hartman
Browse files

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: default avatarJiri Slaby (SUSE) <jirislaby@kernel.org>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20251119091949.825958-4-jirislaby@kernel.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 48e77862
Loading
Loading
Loading
Loading
+0 −62
Original line number Diff line number Diff line
@@ -86,40 +86,8 @@ module_param_hw(mwave_3780i_io, int, ioport, 0);
module_param_hw(mwave_uart_irq, int, irq, 0);
module_param_hw(mwave_uart_io, int, ioport, 0);

static int mwave_open(struct inode *inode, struct file *file);
static int mwave_close(struct inode *inode, struct file *file);
static long mwave_ioctl(struct file *filp, unsigned int iocmd,
							unsigned long ioarg);

MWAVE_DEVICE_DATA mwave_s_mdd;

static int mwave_open(struct inode *inode, struct file *file)
{
	unsigned int retval = 0;

	PRINTK_3(TRACE_MWAVE,
		"mwavedd::mwave_open, entry inode %p file %p\n",
		 inode, file);
	PRINTK_2(TRACE_MWAVE,
		"mwavedd::mwave_open, exit return retval %x\n", retval);

	return retval;
}

static int mwave_close(struct inode *inode, struct file *file)
{
	unsigned int retval = 0;

	PRINTK_3(TRACE_MWAVE,
		"mwavedd::mwave_close, entry inode %p file %p\n",
		 inode,  file);

	PRINTK_2(TRACE_MWAVE, "mwavedd::mwave_close, exit retval %x\n",
		retval);

	return retval;
}

static long mwave_ioctl(struct file *file, unsigned int iocmd,
							unsigned long ioarg)
{
@@ -410,30 +378,6 @@ static long mwave_ioctl(struct file *file, unsigned int iocmd,
	return retval;
}


static ssize_t mwave_read(struct file *file, char __user *buf, size_t count,
                          loff_t * ppos)
{
	PRINTK_5(TRACE_MWAVE,
		"mwavedd::mwave_read entry file %p, buf %p, count %zx ppos %p\n",
		file, buf, count, ppos);

	return -EINVAL;
}


static ssize_t mwave_write(struct file *file, const char __user *buf,
                           size_t count, loff_t * ppos)
{
	PRINTK_5(TRACE_MWAVE,
		"mwavedd::mwave_write entry file %p, buf %p,"
		" count %zx ppos %p\n",
		file, buf, count, ppos);

	return -EINVAL;
}


static int register_serial_portandirq(unsigned int port, int irq)
{
	struct uart_8250_port uart;
@@ -478,18 +422,12 @@ static int register_serial_portandirq(unsigned int port, int irq)
	return serial8250_register_8250_port(&uart);
}


static const struct file_operations mwave_fops = {
	.owner		= THIS_MODULE,
	.read		= mwave_read,
	.write		= mwave_write,
	.unlocked_ioctl	= mwave_ioctl,
	.open		= mwave_open,
	.release	= mwave_close,
	.llseek		= default_llseek,
};


static struct miscdevice mwave_misc_dev = { MWAVE_MINOR, "mwave", &mwave_fops };

/*