aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorDavid Kershner <david.kershner@unisys.com>2016-09-19 17:09:32 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-09-20 07:28:17 -0400
commit79730c7c8148f68144540181b8b53b1e9639f9b7 (patch)
tree8f429d4c17aa16d3dd78bd6e798b82d9c20da517 /drivers/staging
parent8a4a8a03d3a378694ba4170370a447d3e0df3ad9 (diff)
staging: unisys: visorbus: move textid store and show functions
The textid store and show functions were moved to allow us to remove the function prototypes. 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.c63
1 files changed, 29 insertions, 34 deletions
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
index 951eaea8ad9b..5ba5f1970688 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -288,9 +288,36 @@ static ssize_t error_store(struct device *dev, struct device_attribute *attr,
288static DEVICE_ATTR_RW(error); 288static DEVICE_ATTR_RW(error);
289 289
290static ssize_t textid_show(struct device *dev, struct device_attribute *attr, 290static ssize_t textid_show(struct device *dev, struct device_attribute *attr,
291 char *buf); 291 char *buf)
292{
293 u32 text_id = 0;
294
295 visorchannel_read
296 (controlvm_channel,
297 offsetof(struct spar_controlvm_channel_protocol,
298 installation_text_id),
299 &text_id, sizeof(u32));
300 return scnprintf(buf, PAGE_SIZE, "%i\n", text_id);
301}
302
292static ssize_t textid_store(struct device *dev, struct device_attribute *attr, 303static ssize_t textid_store(struct device *dev, struct device_attribute *attr,
293 const char *buf, size_t count); 304 const char *buf, size_t count)
305{
306 u32 text_id;
307 int ret;
308
309 if (kstrtou32(buf, 10, &text_id))
310 return -EINVAL;
311
312 ret = visorchannel_write
313 (controlvm_channel,
314 offsetof(struct spar_controlvm_channel_protocol,
315 installation_text_id),
316 &text_id, sizeof(u32));
317 if (ret)
318 return ret;
319 return count;
320}
294static DEVICE_ATTR_RW(textid); 321static DEVICE_ATTR_RW(textid);
295 322
296static ssize_t remaining_steps_show(struct device *dev, 323static ssize_t remaining_steps_show(struct device *dev,
@@ -449,38 +476,6 @@ parser_string_get(struct parser_context *ctx)
449 return value; 476 return value;
450} 477}
451 478
452static ssize_t textid_show(struct device *dev, struct device_attribute *attr,
453 char *buf)
454{
455 u32 text_id = 0;
456
457 visorchannel_read
458 (controlvm_channel,
459 offsetof(struct spar_controlvm_channel_protocol,
460 installation_text_id),
461 &text_id, sizeof(u32));
462 return scnprintf(buf, PAGE_SIZE, "%i\n", text_id);
463}
464
465static ssize_t textid_store(struct device *dev, struct device_attribute *attr,
466 const char *buf, size_t count)
467{
468 u32 text_id;
469 int ret;
470
471 if (kstrtou32(buf, 10, &text_id))
472 return -EINVAL;
473
474 ret = visorchannel_write
475 (controlvm_channel,
476 offsetof(struct spar_controlvm_channel_protocol,
477 installation_text_id),
478 &text_id, sizeof(u32));
479 if (ret)
480 return ret;
481 return count;
482}
483
484static ssize_t remaining_steps_show(struct device *dev, 479static ssize_t remaining_steps_show(struct device *dev,
485 struct device_attribute *attr, char *buf) 480 struct device_attribute *attr, char *buf)
486{ 481{