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>
This commit is contained in:
parent
79730c7c81
commit
97f792ee3c
|
@ -321,10 +321,36 @@ static ssize_t textid_store(struct device *dev, struct device_attribute *attr,
|
||||||
static DEVICE_ATTR_RW(textid);
|
static DEVICE_ATTR_RW(textid);
|
||||||
|
|
||||||
static ssize_t remaining_steps_show(struct device *dev,
|
static ssize_t remaining_steps_show(struct device *dev,
|
||||||
struct device_attribute *attr, char *buf);
|
struct device_attribute *attr, char *buf)
|
||||||
|
{
|
||||||
|
u16 remaining_steps = 0;
|
||||||
|
|
||||||
|
visorchannel_read(controlvm_channel,
|
||||||
|
offsetof(struct spar_controlvm_channel_protocol,
|
||||||
|
installation_remaining_steps),
|
||||||
|
&remaining_steps, sizeof(u16));
|
||||||
|
return scnprintf(buf, PAGE_SIZE, "%hu\n", remaining_steps);
|
||||||
|
}
|
||||||
|
|
||||||
static ssize_t remaining_steps_store(struct device *dev,
|
static ssize_t remaining_steps_store(struct device *dev,
|
||||||
struct device_attribute *attr,
|
struct device_attribute *attr,
|
||||||
const char *buf, size_t count);
|
const char *buf, size_t count)
|
||||||
|
{
|
||||||
|
u16 remaining_steps;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
if (kstrtou16(buf, 10, &remaining_steps))
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
ret = visorchannel_write
|
||||||
|
(controlvm_channel,
|
||||||
|
offsetof(struct spar_controlvm_channel_protocol,
|
||||||
|
installation_remaining_steps),
|
||||||
|
&remaining_steps, sizeof(u16));
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
return count;
|
||||||
|
}
|
||||||
static DEVICE_ATTR_RW(remaining_steps);
|
static DEVICE_ATTR_RW(remaining_steps);
|
||||||
|
|
||||||
static ssize_t devicedisabled_store(struct device *dev,
|
static ssize_t devicedisabled_store(struct device *dev,
|
||||||
|
@ -476,38 +502,6 @@ parser_string_get(struct parser_context *ctx)
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t remaining_steps_show(struct device *dev,
|
|
||||||
struct device_attribute *attr, char *buf)
|
|
||||||
{
|
|
||||||
u16 remaining_steps = 0;
|
|
||||||
|
|
||||||
visorchannel_read(controlvm_channel,
|
|
||||||
offsetof(struct spar_controlvm_channel_protocol,
|
|
||||||
installation_remaining_steps),
|
|
||||||
&remaining_steps, sizeof(u16));
|
|
||||||
return scnprintf(buf, PAGE_SIZE, "%hu\n", remaining_steps);
|
|
||||||
}
|
|
||||||
|
|
||||||
static ssize_t remaining_steps_store(struct device *dev,
|
|
||||||
struct device_attribute *attr,
|
|
||||||
const char *buf, size_t count)
|
|
||||||
{
|
|
||||||
u16 remaining_steps;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (kstrtou16(buf, 10, &remaining_steps))
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
ret = visorchannel_write
|
|
||||||
(controlvm_channel,
|
|
||||||
offsetof(struct spar_controlvm_channel_protocol,
|
|
||||||
installation_remaining_steps),
|
|
||||||
&remaining_steps, sizeof(u16));
|
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
return count;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct visor_busdev {
|
struct visor_busdev {
|
||||||
u32 bus_no;
|
u32 bus_no;
|
||||||
u32 dev_no;
|
u32 dev_no;
|
||||||
|
|
Loading…
Reference in New Issue