diff options
author | David Kershner <david.kershner@unisys.com> | 2016-09-19 17:09:31 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-09-20 07:28:17 -0400 |
commit | 8a4a8a03d3a378694ba4170370a447d3e0df3ad9 (patch) | |
tree | 8cffd535d51734059247996a45f4ac72e9dfec3b /drivers/staging | |
parent | 65cb1a8c5471ee2aed372dbf69a51457d15de056 (diff) |
staging: unisys: visorbus: move error store/show functions
Move the show and store functions for the error DEV_ATTR_RW so that the
function prototypes can be removed.
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')
-rw-r--r-- | drivers/staging/unisys/visorbus/visorchipset.c | 61 |
1 files changed, 28 insertions, 33 deletions
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index d50e4cde3211..951eaea8ad9b 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c | |||
@@ -256,9 +256,35 @@ static ssize_t boottotool_store(struct device *dev, | |||
256 | static DEVICE_ATTR_RW(boottotool); | 256 | static DEVICE_ATTR_RW(boottotool); |
257 | 257 | ||
258 | static ssize_t error_show(struct device *dev, struct device_attribute *attr, | 258 | static ssize_t error_show(struct device *dev, struct device_attribute *attr, |
259 | char *buf); | 259 | char *buf) |
260 | { | ||
261 | u32 error = 0; | ||
262 | |||
263 | visorchannel_read(controlvm_channel, | ||
264 | offsetof(struct spar_controlvm_channel_protocol, | ||
265 | installation_error), | ||
266 | &error, sizeof(u32)); | ||
267 | return scnprintf(buf, PAGE_SIZE, "%i\n", error); | ||
268 | } | ||
269 | |||
260 | static ssize_t error_store(struct device *dev, struct device_attribute *attr, | 270 | static ssize_t error_store(struct device *dev, struct device_attribute *attr, |
261 | const char *buf, size_t count); | 271 | const char *buf, size_t count) |
272 | { | ||
273 | u32 error; | ||
274 | int ret; | ||
275 | |||
276 | if (kstrtou32(buf, 10, &error)) | ||
277 | return -EINVAL; | ||
278 | |||
279 | ret = visorchannel_write | ||
280 | (controlvm_channel, | ||
281 | offsetof(struct spar_controlvm_channel_protocol, | ||
282 | installation_error), | ||
283 | &error, sizeof(u32)); | ||
284 | if (ret) | ||
285 | return ret; | ||
286 | return count; | ||
287 | } | ||
262 | static DEVICE_ATTR_RW(error); | 288 | static DEVICE_ATTR_RW(error); |
263 | 289 | ||
264 | static ssize_t textid_show(struct device *dev, struct device_attribute *attr, | 290 | static ssize_t textid_show(struct device *dev, struct device_attribute *attr, |
@@ -423,37 +449,6 @@ parser_string_get(struct parser_context *ctx) | |||
423 | return value; | 449 | return value; |
424 | } | 450 | } |
425 | 451 | ||
426 | static ssize_t error_show(struct device *dev, struct device_attribute *attr, | ||
427 | char *buf) | ||
428 | { | ||
429 | u32 error = 0; | ||
430 | |||
431 | visorchannel_read(controlvm_channel, | ||
432 | offsetof(struct spar_controlvm_channel_protocol, | ||
433 | installation_error), | ||
434 | &error, sizeof(u32)); | ||
435 | return scnprintf(buf, PAGE_SIZE, "%i\n", error); | ||
436 | } | ||
437 | |||
438 | static ssize_t error_store(struct device *dev, struct device_attribute *attr, | ||
439 | const char *buf, size_t count) | ||
440 | { | ||
441 | u32 error; | ||
442 | int ret; | ||
443 | |||
444 | if (kstrtou32(buf, 10, &error)) | ||
445 | return -EINVAL; | ||
446 | |||
447 | ret = visorchannel_write | ||
448 | (controlvm_channel, | ||
449 | offsetof(struct spar_controlvm_channel_protocol, | ||
450 | installation_error), | ||
451 | &error, sizeof(u32)); | ||
452 | if (ret) | ||
453 | return ret; | ||
454 | return count; | ||
455 | } | ||
456 | |||
457 | static ssize_t textid_show(struct device *dev, struct device_attribute *attr, | 452 | static ssize_t textid_show(struct device *dev, struct device_attribute *attr, |
458 | char *buf) | 453 | char *buf) |
459 | { | 454 | { |