mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 04:12:04 -04:00
Merge "soc: qcom: hab: Updating return value for function attributed to kobject"
This commit is contained in:
commit
bca4e894c5
1 changed files with 16 additions and 10 deletions
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
#include "hab.h"
|
||||
#include <linux/rtc.h>
|
||||
|
|
@ -274,7 +274,7 @@ static ssize_t vchan_store(struct kobject *kobj, struct kobj_attribute *attr,
|
|||
pr_err("failed to read anything from input %d\n", ret);
|
||||
return 0;
|
||||
} else
|
||||
return vchan_stat;
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t ctx_show(struct kobject *kobj, struct kobj_attribute *attr,
|
||||
|
|
@ -293,7 +293,7 @@ static ssize_t ctx_store(struct kobject *kobj, struct kobj_attribute *attr,
|
|||
pr_err("failed to read anything from input %d\n", ret);
|
||||
return 0;
|
||||
} else
|
||||
return context_stat;
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t expimp_show(struct kobject *kobj, struct kobj_attribute *attr,
|
||||
|
|
@ -305,10 +305,11 @@ static ssize_t expimp_show(struct kobject *kobj, struct kobj_attribute *attr,
|
|||
static ssize_t expimp_store(struct kobject *kobj, struct kobj_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
int ret;
|
||||
int ret = -1;
|
||||
char str[36] = {0};
|
||||
unsigned long temp;
|
||||
|
||||
ret = sscanf(buf, "%35s", str);
|
||||
ret = sscanf(buf, "%s", str);
|
||||
if (ret < 1)
|
||||
pr_err("failed to read anything from input %d\n", ret);
|
||||
|
||||
|
|
@ -319,11 +320,16 @@ static ssize_t expimp_store(struct kobject *kobj, struct kobj_attribute *attr,
|
|||
return strlen("dump_pipe");
|
||||
}
|
||||
|
||||
ret = sscanf(buf, "%du", &pid_stat);
|
||||
if (ret < 1)
|
||||
pr_err("failed to read anything from input %d\n", ret);
|
||||
else
|
||||
return pid_stat; /* good result stored */
|
||||
if (buf) {
|
||||
ret = kstrtol(buf, 10, &temp);
|
||||
pid_stat = temp;
|
||||
|
||||
if (ret < 0)
|
||||
pr_err("failed to read anything from input %d\n", ret);
|
||||
else
|
||||
return count; /* good result stored */
|
||||
}
|
||||
|
||||
return -EEXIST;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue