qcom-charger: handle get prop errors graciously
Currently the code passes on the error value it receives from the individual property getters. This causes the read of uevent to fail. Instead convert those errors to -ENODATA which the power supply framework handles graciously and keeps the read of uevent entry from failing. It simply skips reporting that property in uevent. Change-Id: I997197c7c7315769e49342da7973a9f79ab54c80 Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
This commit is contained in:
parent
819032fadd
commit
3850d272a6
2 changed files with 31 additions and 13 deletions
|
@ -392,7 +392,11 @@ static int smb2_usb_get_prop(struct power_supply *psy,
|
|||
rc = -EINVAL;
|
||||
break;
|
||||
}
|
||||
return rc;
|
||||
if (rc < 0) {
|
||||
pr_debug("Couldn't get prop %d rc = %d\n", psp, rc);
|
||||
return -ENODATA;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int smb2_usb_set_prop(struct power_supply *psy,
|
||||
|
@ -506,8 +510,11 @@ static int smb2_dc_get_prop(struct power_supply *psy,
|
|||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return rc;
|
||||
if (rc < 0) {
|
||||
pr_debug("Couldn't get prop %d rc = %d\n", psp, rc);
|
||||
return -ENODATA;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int smb2_dc_set_prop(struct power_supply *psy,
|
||||
|
@ -633,8 +640,11 @@ static int smb2_batt_get_prop(struct power_supply *psy,
|
|||
pr_err("batt power supply prop %d not supported\n", psp);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return rc;
|
||||
if (rc < 0) {
|
||||
pr_debug("Couldn't get prop %d rc = %d\n", psp, rc);
|
||||
return -ENODATA;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int smb2_batt_set_prop(struct power_supply *psy,
|
||||
|
|
|
@ -184,8 +184,11 @@ static int smb138x_usb_get_prop(struct power_supply *psy,
|
|||
pr_err("get prop %d is not supported\n", prop);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return rc;
|
||||
if (rc < 0) {
|
||||
pr_debug("Couldn't get prop %d rc = %d\n", prop, rc);
|
||||
return -ENODATA;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int smb138x_usb_set_prop(struct power_supply *psy,
|
||||
|
@ -297,12 +300,14 @@ static int smb138x_batt_get_prop(struct power_supply *psy,
|
|||
rc = smblib_get_prop_batt_capacity(chg, val);
|
||||
break;
|
||||
default:
|
||||
pr_err("batt power supply get prop %d not supported\n",
|
||||
prop);
|
||||
pr_err("batt power supply get prop %d not supported\n", prop);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return rc;
|
||||
if (rc < 0) {
|
||||
pr_debug("Couldn't get prop %d rc = %d\n", prop, rc);
|
||||
return -ENODATA;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int smb138x_batt_set_prop(struct power_supply *psy,
|
||||
|
@ -420,8 +425,11 @@ static int smb138x_parallel_get_prop(struct power_supply *psy,
|
|||
prop);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return rc;
|
||||
if (rc < 0) {
|
||||
pr_debug("Couldn't get prop %d rc = %d\n", prop, rc);
|
||||
return -ENODATA;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int smb138x_parallel_set_prop(struct power_supply *psy,
|
||||
|
|
Loading…
Add table
Reference in a new issue