smb138x: fix WD bite
Commit 85635da429
("qcom-charger: smb138x: fix buck damage on
v1.1 hardware") introduced wa_flags as the first member
in the struct. However there are implict assumptions in the driver that
the first member is the library structure. This causes memory corruption
and an eventual watch dog bite reset.
Fix it by ensuring that the library struct is explicitly initialized
from the parent struct.
CRs-Fixed: 1055113
Change-Id: I38474a228ec7b245dc330b4a37847c9f1bf29c2a
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
This commit is contained in:
parent
c605e110ab
commit
aecb04a1c3
1 changed files with 9 additions and 5 deletions
|
@ -77,10 +77,10 @@ struct smb_dt_props {
|
|||
};
|
||||
|
||||
struct smb138x {
|
||||
u32 wa_flags;
|
||||
struct smb_charger chg;
|
||||
struct smb_dt_props dt;
|
||||
struct power_supply *parallel_psy;
|
||||
u32 wa_flags;
|
||||
};
|
||||
|
||||
static int __debug_mask;
|
||||
|
@ -269,7 +269,8 @@ static int smb138x_batt_get_prop(struct power_supply *psy,
|
|||
enum power_supply_property prop,
|
||||
union power_supply_propval *val)
|
||||
{
|
||||
struct smb_charger *chg = power_supply_get_drvdata(psy);
|
||||
struct smb138x *chip = power_supply_get_drvdata(psy);
|
||||
struct smb_charger *chg = &chip->chg;
|
||||
int rc = 0;
|
||||
|
||||
switch (prop) {
|
||||
|
@ -304,7 +305,8 @@ static int smb138x_batt_set_prop(struct power_supply *psy,
|
|||
enum power_supply_property prop,
|
||||
const union power_supply_propval *val)
|
||||
{
|
||||
struct smb_charger *chg = power_supply_get_drvdata(psy);
|
||||
struct smb138x *chip = power_supply_get_drvdata(psy);
|
||||
struct smb_charger *chg = &chip->chg;
|
||||
int rc = 0;
|
||||
|
||||
switch (prop) {
|
||||
|
@ -378,7 +380,8 @@ static int smb138x_parallel_get_prop(struct power_supply *psy,
|
|||
enum power_supply_property prop,
|
||||
union power_supply_propval *val)
|
||||
{
|
||||
struct smb_charger *chg = power_supply_get_drvdata(psy);
|
||||
struct smb138x *chip = power_supply_get_drvdata(psy);
|
||||
struct smb_charger *chg = &chip->chg;
|
||||
int rc = 0;
|
||||
u8 temp;
|
||||
|
||||
|
@ -418,7 +421,8 @@ static int smb138x_parallel_set_prop(struct power_supply *psy,
|
|||
enum power_supply_property prop,
|
||||
const union power_supply_propval *val)
|
||||
{
|
||||
struct smb_charger *chg = power_supply_get_drvdata(psy);
|
||||
struct smb138x *chip = power_supply_get_drvdata(psy);
|
||||
struct smb_charger *chg = &chip->chg;
|
||||
int rc = 0;
|
||||
|
||||
switch (prop) {
|
||||
|
|
Loading…
Add table
Reference in a new issue