mirror of
https://gitlab.com/manzerbredes/ina260-sysfs-driver.git
synced 2025-04-17 11:23:02 +00:00
Minor changes
This commit is contained in:
parent
4db195b0d6
commit
216617cb72
1 changed files with 2 additions and 2 deletions
4
ina260.c
4
ina260.c
|
@ -114,7 +114,7 @@ static ssize_t attr_store(struct kobject *_kobj,
|
|||
struct client_data *cdata=container_of(_kobj,struct client_data,kobj);
|
||||
int data;
|
||||
unsigned char reg=INA260_REG_CONFIGURATION;
|
||||
if(kstrtoint(buf, 10,&data))
|
||||
if(kstrtoint_from_user(buf, count, 10,&data))
|
||||
return -EINVAL;
|
||||
|
||||
if (INA260_IS_ATTR(mask_enable)){
|
||||
|
@ -251,7 +251,7 @@ static ssize_t attr_field_store(struct kobject *_kobj,
|
|||
int data=0, ret=count;
|
||||
unsigned char reg=INA260_REG_CONFIGURATION;
|
||||
// Extract user supplied value
|
||||
if(kstrtoint(buf, 10,&data))
|
||||
if(kstrtoint_from_user(buf, count, 10,&data))
|
||||
return -EINVAL;
|
||||
// Store:
|
||||
if(INA260_IS_ATTR(reset) && data!=0){
|
||||
|
|
Loading…
Add table
Reference in a new issue