diff options
author | David Kershner <david.kershner@unisys.com> | 2016-09-19 17:09:29 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-09-20 13:26:21 +0200 |
commit | 84efd2077c1e935c4123e5688ba86062f608bb73 (patch) | |
tree | a946ebe8423a0c3845a683c80136452d258ffcb2 /drivers/staging/unisys | |
parent | 5f2513950f1f8b9acc740720b89389b2aa24ac72 (diff) | |
download | talos-obmc-linux-84efd2077c1e935c4123e5688ba86062f608bb73.tar.gz talos-obmc-linux-84efd2077c1e935c4123e5688ba86062f608bb73.zip |
staging: unisys: visorbus: move toolaction functions to remove prototypes
The toolchain functions show and store needed to be moved so the prototypes
were no longer needed.
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/unisys')
-rw-r--r-- | drivers/staging/unisys/visorbus/visorchipset.c | 64 |
1 files changed, 29 insertions, 35 deletions
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 7dcf0b3a1017..568ff9ea0bc3 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -185,10 +185,37 @@ static dev_t major_dev = -1; /*< indicates major num for device */ /* prototypes for attributes */ static ssize_t toolaction_show(struct device *dev, - struct device_attribute *attr, char *buf); + struct device_attribute *attr, + char *buf) +{ + u8 tool_action = 0; + + visorchannel_read(controlvm_channel, + offsetof(struct spar_controlvm_channel_protocol, + tool_action), &tool_action, sizeof(u8)); + return scnprintf(buf, PAGE_SIZE, "%u\n", tool_action); +} + static ssize_t toolaction_store(struct device *dev, struct device_attribute *attr, - const char *buf, size_t count); + const char *buf, size_t count) +{ + u8 tool_action; + int ret; + + if (kstrtou8(buf, 10, &tool_action)) + return -EINVAL; + + ret = visorchannel_write + (controlvm_channel, + offsetof(struct spar_controlvm_channel_protocol, + tool_action), + &tool_action, sizeof(u8)); + + if (ret) + return ret; + return count; +} static DEVICE_ATTR_RW(toolaction); static ssize_t boottotool_show(struct device *dev, @@ -431,39 +458,6 @@ parser_string_get(struct parser_context *ctx) return value; } -static ssize_t toolaction_show(struct device *dev, - struct device_attribute *attr, - char *buf) -{ - u8 tool_action = 0; - - visorchannel_read(controlvm_channel, - offsetof(struct spar_controlvm_channel_protocol, - tool_action), &tool_action, sizeof(u8)); - return scnprintf(buf, PAGE_SIZE, "%u\n", tool_action); -} - -static ssize_t toolaction_store(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - u8 tool_action; - int ret; - - if (kstrtou8(buf, 10, &tool_action)) - return -EINVAL; - - ret = visorchannel_write - (controlvm_channel, - offsetof(struct spar_controlvm_channel_protocol, - tool_action), - &tool_action, sizeof(u8)); - - if (ret) - return ret; - return count; -} - static ssize_t boottotool_show(struct device *dev, struct device_attribute *attr, char *buf) |