Merge "qcom-charger: handle get prop errors graciously"
This commit is contained in:
commit
a8f7b70106
3 changed files with 33 additions and 13 deletions
|
@ -11,6 +11,8 @@
|
|||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#define pr_fmt(fmt) "RRADC: %s: " fmt, __func__
|
||||
|
||||
#include <linux/iio/iio.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/math64.h>
|
||||
|
|
|
@ -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,
|
||||
|
@ -305,12 +308,14 @@ static int smb138x_batt_get_prop(struct power_supply *psy,
|
|||
rc = smblib_get_prop_charger_temp_max(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,
|
||||
|
@ -436,8 +441,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