Commit aeeadf91 authored by Rob Radez's avatar Rob Radez Committed by Linus Torvalds

[PATCH] remove unnecessary stubs from watchdog drivers

This removes some function stubs from 6 watchdog drivers.

The VFS already returns -EINVAL in cases where fop->read == NULL, so
there's no need to duplicate the code 6 times.  This patch removes the
stubs and is compile tested.
parent d4794d6c
...@@ -96,13 +96,6 @@ static ssize_t acq_write(struct file *file, const char *buf, size_t count, loff_ ...@@ -96,13 +96,6 @@ static ssize_t acq_write(struct file *file, const char *buf, size_t count, loff_
return 0; return 0;
} }
static ssize_t acq_read(struct file *file, char *buf, size_t count, loff_t *ppos)
{
return -EINVAL;
}
static int acq_ioctl(struct inode *inode, struct file *file, unsigned int cmd, static int acq_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg) unsigned long arg)
{ {
...@@ -193,7 +186,6 @@ static int acq_notify_sys(struct notifier_block *this, unsigned long code, ...@@ -193,7 +186,6 @@ static int acq_notify_sys(struct notifier_block *this, unsigned long code,
static struct file_operations acq_fops = { static struct file_operations acq_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.read = acq_read,
.write = acq_write, .write = acq_write,
.ioctl = acq_ioctl, .ioctl = acq_ioctl,
.open = acq_open, .open = acq_open,
......
...@@ -183,12 +183,6 @@ static ssize_t fop_write(struct file * file, const char * buf, size_t count, lof ...@@ -183,12 +183,6 @@ static ssize_t fop_write(struct file * file, const char * buf, size_t count, lof
return 0; return 0;
} }
static ssize_t fop_read(struct file * file, char * buf, size_t count, loff_t * ppos)
{
/* No can do */
return -EINVAL;
}
static int fop_open(struct inode * inode, struct file * file) static int fop_open(struct inode * inode, struct file * file)
{ {
/* Just in case we're already talking to someone... */ /* Just in case we're already talking to someone... */
...@@ -234,7 +228,6 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u ...@@ -234,7 +228,6 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
static struct file_operations wdt_fops = { static struct file_operations wdt_fops = {
.owner= THIS_MODULE, .owner= THIS_MODULE,
.llseek= no_llseek, .llseek= no_llseek,
.read= fop_read,
.write= fop_write, .write= fop_write,
.open= fop_open, .open= fop_open,
.release= fop_close, .release= fop_close,
......
...@@ -166,12 +166,6 @@ ibwdt_write(struct file *file, const char *buf, size_t count, loff_t *ppos) ...@@ -166,12 +166,6 @@ ibwdt_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
return 0; return 0;
} }
static ssize_t
ibwdt_read(struct file *file, char *buf, size_t count, loff_t *ppos)
{
return -EINVAL;
}
static int static int
ibwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ibwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg) unsigned long arg)
...@@ -280,7 +274,6 @@ ibwdt_notify_sys(struct notifier_block *this, unsigned long code, ...@@ -280,7 +274,6 @@ ibwdt_notify_sys(struct notifier_block *this, unsigned long code,
static struct file_operations ibwdt_fops = { static struct file_operations ibwdt_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.read = ibwdt_read,
.write = ibwdt_write, .write = ibwdt_write,
.ioctl = ibwdt_ioctl, .ioctl = ibwdt_ioctl,
.open = ibwdt_open, .open = ibwdt_open,
......
...@@ -349,14 +349,6 @@ static ssize_t zf_write(struct file *file, const char *buf, size_t count, ...@@ -349,14 +349,6 @@ static ssize_t zf_write(struct file *file, const char *buf, size_t count,
return 0; return 0;
} }
static ssize_t zf_read(struct file *file, char *buf, size_t count,
loff_t *ppos)
{
return -EINVAL;
}
static int zf_ioctl(struct inode *inode, struct file *file, unsigned int cmd, static int zf_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg) unsigned long arg)
{ {
...@@ -448,7 +440,6 @@ static int zf_notify_sys(struct notifier_block *this, unsigned long code, ...@@ -448,7 +440,6 @@ static int zf_notify_sys(struct notifier_block *this, unsigned long code,
static struct file_operations zf_fops = { static struct file_operations zf_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.read = zf_read,
.write = zf_write, .write = zf_write,
.ioctl = zf_ioctl, .ioctl = zf_ioctl,
.open = zf_open, .open = zf_open,
......
...@@ -194,12 +194,6 @@ static ssize_t fop_write(struct file * file, const char * buf, size_t count, lof ...@@ -194,12 +194,6 @@ static ssize_t fop_write(struct file * file, const char * buf, size_t count, lof
return 0; return 0;
} }
static ssize_t fop_read(struct file * file, char * buf, size_t count, loff_t * ppos)
{
/* No can do */
return -EINVAL;
}
static int fop_open(struct inode * inode, struct file * file) static int fop_open(struct inode * inode, struct file * file)
{ {
switch(minor(inode->i_rdev)) switch(minor(inode->i_rdev))
...@@ -260,7 +254,6 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -260,7 +254,6 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
static struct file_operations wdt_fops = { static struct file_operations wdt_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.llseek = no_llseek, .llseek = no_llseek,
.read = fop_read,
.write = fop_write, .write = fop_write,
.open = fop_open, .open = fop_open,
.release = fop_close, .release = fop_close,
......
...@@ -202,12 +202,6 @@ static ssize_t fop_write(struct file * file, const char * buf, size_t count, lof ...@@ -202,12 +202,6 @@ static ssize_t fop_write(struct file * file, const char * buf, size_t count, lof
return 0; return 0;
} }
static ssize_t fop_read(struct file * file, char * buf, size_t count, loff_t * ppos)
{
/* No can do */
return -EINVAL;
}
static int fop_open(struct inode * inode, struct file * file) static int fop_open(struct inode * inode, struct file * file)
{ {
switch(minor(inode->i_rdev)) switch(minor(inode->i_rdev))
...@@ -268,7 +262,6 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -268,7 +262,6 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
static struct file_operations wdt_fops = { static struct file_operations wdt_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.llseek = no_llseek, .llseek = no_llseek,
.read = fop_read,
.write = fop_write, .write = fop_write,
.open = fop_open, .open = fop_open,
.release = fop_close, .release = fop_close,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment