aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorDavid Kershner <david.kershner@unisys.com>2016-09-19 17:09:30 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-09-20 07:26:21 -0400
commit1b1d463d08be0785b48ad8b23446ac13f726a60b (patch)
tree3e9bdb99c74397932ba3af1d0153848b844e7aa8 /drivers/staging
parent84efd2077c1e935c4123e5688ba86062f608bb73 (diff)
staging: unisys: visorbus: move boottotool
Move the boottotool show and store functions so 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.c72
1 files changed, 33 insertions, 39 deletions
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
index 568ff9ea0bc3..8081160720a4 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -219,10 +219,40 @@ static ssize_t toolaction_store(struct device *dev,
219static DEVICE_ATTR_RW(toolaction); 219static DEVICE_ATTR_RW(toolaction);
220 220
221static ssize_t boottotool_show(struct device *dev, 221static ssize_t boottotool_show(struct device *dev,
222 struct device_attribute *attr, char *buf); 222 struct device_attribute *attr,
223 char *buf)
224{
225 struct efi_spar_indication efi_spar_indication;
226
227 visorchannel_read(controlvm_channel,
228 offsetof(struct spar_controlvm_channel_protocol,
229 efi_spar_ind), &efi_spar_indication,
230 sizeof(struct efi_spar_indication));
231 return scnprintf(buf, PAGE_SIZE, "%u\n",
232 efi_spar_indication.boot_to_tool);
233}
234
223static ssize_t boottotool_store(struct device *dev, 235static ssize_t boottotool_store(struct device *dev,
224 struct device_attribute *attr, const char *buf, 236 struct device_attribute *attr,
225 size_t count); 237 const char *buf, size_t count)
238{
239 int val, ret;
240 struct efi_spar_indication efi_spar_indication;
241
242 if (kstrtoint(buf, 10, &val))
243 return -EINVAL;
244
245 efi_spar_indication.boot_to_tool = val;
246 ret = visorchannel_write
247 (controlvm_channel,
248 offsetof(struct spar_controlvm_channel_protocol,
249 efi_spar_ind), &(efi_spar_indication),
250 sizeof(struct efi_spar_indication));
251
252 if (ret)
253 return ret;
254 return count;
255}
226static DEVICE_ATTR_RW(boottotool); 256static DEVICE_ATTR_RW(boottotool);
227 257
228static ssize_t error_show(struct device *dev, struct device_attribute *attr, 258static ssize_t error_show(struct device *dev, struct device_attribute *attr,
@@ -458,42 +488,6 @@ parser_string_get(struct parser_context *ctx)
458 return value; 488 return value;
459} 489}
460 490
461static ssize_t boottotool_show(struct device *dev,
462 struct device_attribute *attr,
463 char *buf)
464{
465 struct efi_spar_indication efi_spar_indication;
466
467 visorchannel_read(controlvm_channel,
468 offsetof(struct spar_controlvm_channel_protocol,
469 efi_spar_ind), &efi_spar_indication,
470 sizeof(struct efi_spar_indication));
471 return scnprintf(buf, PAGE_SIZE, "%u\n",
472 efi_spar_indication.boot_to_tool);
473}
474
475static ssize_t boottotool_store(struct device *dev,
476 struct device_attribute *attr,
477 const char *buf, size_t count)
478{
479 int val, ret;
480 struct efi_spar_indication efi_spar_indication;
481
482 if (kstrtoint(buf, 10, &val))
483 return -EINVAL;
484
485 efi_spar_indication.boot_to_tool = val;
486 ret = visorchannel_write
487 (controlvm_channel,
488 offsetof(struct spar_controlvm_channel_protocol,
489 efi_spar_ind), &(efi_spar_indication),
490 sizeof(struct efi_spar_indication));
491
492 if (ret)
493 return ret;
494 return count;
495}
496
497static ssize_t error_show(struct device *dev, struct device_attribute *attr, 491static ssize_t error_show(struct device *dev, struct device_attribute *attr,
498 char *buf) 492 char *buf)
499{ 493{