diff options
author | David Kershner <david.kershner@unisys.com> | 2016-09-19 17:09:33 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-09-20 07:28:17 -0400 |
commit | 97f792ee3cd6f62551f6247ca36492615e26cb5e (patch) | |
tree | f01458de85b12a236cedb476e6d013301bc42e70 /drivers/staging | |
parent | 79730c7c8148f68144540181b8b53b1e9639f9b7 (diff) |
staging: unisys: visorbus: move the remaining_steps_show/store functions
Moving the remaining_steps functions allows us to get rid of an unneeded
prototype.
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 | 62 |
1 files changed, 28 insertions, 34 deletions
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 5ba5f1970688..d3efe75fab32 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c | |||
@@ -321,10 +321,36 @@ static ssize_t textid_store(struct device *dev, struct device_attribute *attr, | |||
321 | static DEVICE_ATTR_RW(textid); | 321 | static DEVICE_ATTR_RW(textid); |
322 | 322 | ||
323 | static ssize_t remaining_steps_show(struct device *dev, | 323 | static ssize_t remaining_steps_show(struct device *dev, |
324 | struct device_attribute *attr, char *buf); | 324 | struct device_attribute *attr, char *buf) |
325 | { | ||
326 | u16 remaining_steps = 0; | ||
327 | |||
328 | visorchannel_read(controlvm_channel, | ||
329 | offsetof(struct spar_controlvm_channel_protocol, | ||
330 | installation_remaining_steps), | ||
331 | &remaining_steps, sizeof(u16)); | ||
332 | return scnprintf(buf, PAGE_SIZE, "%hu\n", remaining_steps); | ||
333 | } | ||
334 | |||
325 | static ssize_t remaining_steps_store(struct device *dev, | 335 | static ssize_t remaining_steps_store(struct device *dev, |
326 | struct device_attribute *attr, | 336 | struct device_attribute *attr, |
327 | const char *buf, size_t count); | 337 | const char *buf, size_t count) |
338 | { | ||
339 | u16 remaining_steps; | ||
340 | int ret; | ||
341 | |||
342 | if (kstrtou16(buf, 10, &remaining_steps)) | ||
343 | return -EINVAL; | ||
344 | |||
345 | ret = visorchannel_write | ||
346 | (controlvm_channel, | ||
347 | offsetof(struct spar_controlvm_channel_protocol, | ||
348 | installation_remaining_steps), | ||
349 | &remaining_steps, sizeof(u16)); | ||
350 | if (ret) | ||
351 | return ret; | ||
352 | return count; | ||
353 | } | ||
328 | static DEVICE_ATTR_RW(remaining_steps); | 354 | static DEVICE_ATTR_RW(remaining_steps); |
329 | 355 | ||
330 | static ssize_t devicedisabled_store(struct device *dev, | 356 | static ssize_t devicedisabled_store(struct device *dev, |
@@ -476,38 +502,6 @@ parser_string_get(struct parser_context *ctx) | |||
476 | return value; | 502 | return value; |
477 | } | 503 | } |
478 | 504 | ||
479 | static ssize_t remaining_steps_show(struct device *dev, | ||
480 | struct device_attribute *attr, char *buf) | ||
481 | { | ||
482 | u16 remaining_steps = 0; | ||
483 | |||
484 | visorchannel_read(controlvm_channel, | ||
485 | offsetof(struct spar_controlvm_channel_protocol, | ||
486 | installation_remaining_steps), | ||
487 | &remaining_steps, sizeof(u16)); | ||
488 | return scnprintf(buf, PAGE_SIZE, "%hu\n", remaining_steps); | ||
489 | } | ||
490 | |||
491 | static ssize_t remaining_steps_store(struct device *dev, | ||
492 | struct device_attribute *attr, | ||
493 | const char *buf, size_t count) | ||
494 | { | ||
495 | u16 remaining_steps; | ||
496 | int ret; | ||
497 | |||
498 | if (kstrtou16(buf, 10, &remaining_steps)) | ||
499 | return -EINVAL; | ||
500 | |||
501 | ret = visorchannel_write | ||
502 | (controlvm_channel, | ||
503 | offsetof(struct spar_controlvm_channel_protocol, | ||
504 | installation_remaining_steps), | ||
505 | &remaining_steps, sizeof(u16)); | ||
506 | if (ret) | ||
507 | return ret; | ||
508 | return count; | ||
509 | } | ||
510 | |||
511 | struct visor_busdev { | 505 | struct visor_busdev { |
512 | u32 bus_no; | 506 | u32 bus_no; |
513 | u32 dev_no; | 507 | u32 dev_no; |