@@ -262,9 +262,14 @@ static void gpio_mockup_free(struct gpio_chip *gc, unsigned int offset)
__gpio_mockup_set(chip, offset, chip->lines[offset].pull);
}
-static ssize_t gpio_mockup_debugfs_read(struct file *file,
- char __user *usr_buf,
- size_t size, loff_t *ppos)
+static int gpio_mockup_debugfs_open(struct inode *inode, struct file *file)
+{
+ return single_open(file, NULL, inode->i_private);
+}
+
+static ssize_t gpio_mockup_debugfs_value_read(struct file *file,
+ char __user *usr_buf,
+ size_t size, loff_t *ppos)
{
struct gpio_mockup_dbgfs_private *priv;
struct gpio_mockup_chip *chip;
@@ -287,9 +292,9 @@ static ssize_t gpio_mockup_debugfs_read(struct file *file,
return simple_read_from_buffer(usr_buf, size, ppos, buf, cnt);
}
-static ssize_t gpio_mockup_debugfs_write(struct file *file,
- const char __user *usr_buf,
- size_t size, loff_t *ppos)
+static ssize_t gpio_mockup_debugfs_pull_write(struct file *file,
+ const char __user *usr_buf,
+ size_t size, loff_t *ppos)
{
struct gpio_mockup_dbgfs_private *priv;
int rv, val;
@@ -313,11 +318,6 @@ static ssize_t gpio_mockup_debugfs_write(struct file *file,
return size;
}
-static int gpio_mockup_debugfs_open(struct inode *inode, struct file *file)
-{
- return single_open(file, NULL, inode->i_private);
-}
-
/*
* Each mockup chip is represented by a directory named after the chip's device
* name under /sys/kernel/debug/gpio-mockup/. Each line is represented by
@@ -342,8 +342,8 @@ static int gpio_mockup_debugfs_open(struct inode *inode, struct file *file)
static const struct file_operations gpio_mockup_debugfs_ops = {
.owner = THIS_MODULE,
.open = gpio_mockup_debugfs_open,
- .read = gpio_mockup_debugfs_read,
- .write = gpio_mockup_debugfs_write,
+ .read = gpio_mockup_debugfs_value_read,
+ .write = gpio_mockup_debugfs_pull_write,
.llseek = no_llseek,
.release = single_release,
};