mirror of
https://gitlab.com/manzerbredes/ina260-sysfs-driver.git
synced 2025-04-19 04:09:45 +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);
|
struct client_data *cdata=container_of(_kobj,struct client_data,kobj);
|
||||||
int data;
|
int data;
|
||||||
unsigned char reg=INA260_REG_CONFIGURATION;
|
unsigned char reg=INA260_REG_CONFIGURATION;
|
||||||
if(kstrtoint(buf, 10,&data))
|
if(kstrtoint_from_user(buf, count, 10,&data))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (INA260_IS_ATTR(mask_enable)){
|
if (INA260_IS_ATTR(mask_enable)){
|
||||||
|
@ -251,7 +251,7 @@ static ssize_t attr_field_store(struct kobject *_kobj,
|
||||||
int data=0, ret=count;
|
int data=0, ret=count;
|
||||||
unsigned char reg=INA260_REG_CONFIGURATION;
|
unsigned char reg=INA260_REG_CONFIGURATION;
|
||||||
// Extract user supplied value
|
// Extract user supplied value
|
||||||
if(kstrtoint(buf, 10,&data))
|
if(kstrtoint_from_user(buf, count, 10,&data))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
// Store:
|
// Store:
|
||||||
if(INA260_IS_ATTR(reset) && data!=0){
|
if(INA260_IS_ATTR(reset) && data!=0){
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue