Loading drivers/power/smb135x-charger.c +19 −12 Original line number Diff line number Diff line Loading @@ -1095,6 +1095,9 @@ static int smb135x_set_appropriate_current(struct smb135x_chg *chip, int (*func)(struct smb135x_chg *chip, int current_ma); int rc = 0; if (!chip->usb_psy && path == USB) return 0; /* * If battery is absent do not modify the current at all, these * would be some appropriate values set by the bootloader or default Loading Loading @@ -1646,6 +1649,9 @@ static void smb135x_external_power_changed(struct power_supply *psy) union power_supply_propval prop = {0,}; int rc, current_limit = 0; if (!chip->usb_psy) return; if (chip->bms_psy_name) chip->bms_psy = power_supply_get_by_name((char *)chip->bms_psy_name); Loading Loading @@ -3414,12 +3420,6 @@ static int smb135x_main_charger_probe(struct i2c_client *client, struct power_supply *usb_psy; u8 reg = 0; usb_psy = power_supply_get_by_name("usb"); if (!usb_psy) { dev_dbg(&client->dev, "USB supply not found; defer probe\n"); return -EPROBE_DEFER; } chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL); if (!chip) { dev_err(&client->dev, "Unable to allocate memory\n"); Loading @@ -3428,7 +3428,20 @@ static int smb135x_main_charger_probe(struct i2c_client *client, chip->client = client; chip->dev = &client->dev; rc = smb_parse_dt(chip); if (rc < 0) { dev_err(&client->dev, "Unable to parse DT nodes\n"); return rc; } usb_psy = power_supply_get_by_name("usb"); if (!usb_psy && chip->chg_enabled) { dev_dbg(&client->dev, "USB supply not found; defer probe\n"); return -EPROBE_DEFER; } chip->usb_psy = usb_psy; chip->fake_battery_soc = -EINVAL; INIT_DELAYED_WORK(&chip->wireless_insertion_work, Loading @@ -3444,12 +3457,6 @@ static int smb135x_main_charger_probe(struct i2c_client *client, return -ENODEV; } rc = smb_parse_dt(chip); if (rc < 0) { dev_err(&client->dev, "Unable to parse DT nodes\n"); return rc; } i2c_set_clientdata(client, chip); rc = smb135x_chip_version_and_revision(chip); Loading Loading
drivers/power/smb135x-charger.c +19 −12 Original line number Diff line number Diff line Loading @@ -1095,6 +1095,9 @@ static int smb135x_set_appropriate_current(struct smb135x_chg *chip, int (*func)(struct smb135x_chg *chip, int current_ma); int rc = 0; if (!chip->usb_psy && path == USB) return 0; /* * If battery is absent do not modify the current at all, these * would be some appropriate values set by the bootloader or default Loading Loading @@ -1646,6 +1649,9 @@ static void smb135x_external_power_changed(struct power_supply *psy) union power_supply_propval prop = {0,}; int rc, current_limit = 0; if (!chip->usb_psy) return; if (chip->bms_psy_name) chip->bms_psy = power_supply_get_by_name((char *)chip->bms_psy_name); Loading Loading @@ -3414,12 +3420,6 @@ static int smb135x_main_charger_probe(struct i2c_client *client, struct power_supply *usb_psy; u8 reg = 0; usb_psy = power_supply_get_by_name("usb"); if (!usb_psy) { dev_dbg(&client->dev, "USB supply not found; defer probe\n"); return -EPROBE_DEFER; } chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL); if (!chip) { dev_err(&client->dev, "Unable to allocate memory\n"); Loading @@ -3428,7 +3428,20 @@ static int smb135x_main_charger_probe(struct i2c_client *client, chip->client = client; chip->dev = &client->dev; rc = smb_parse_dt(chip); if (rc < 0) { dev_err(&client->dev, "Unable to parse DT nodes\n"); return rc; } usb_psy = power_supply_get_by_name("usb"); if (!usb_psy && chip->chg_enabled) { dev_dbg(&client->dev, "USB supply not found; defer probe\n"); return -EPROBE_DEFER; } chip->usb_psy = usb_psy; chip->fake_battery_soc = -EINVAL; INIT_DELAYED_WORK(&chip->wireless_insertion_work, Loading @@ -3444,12 +3457,6 @@ static int smb135x_main_charger_probe(struct i2c_client *client, return -ENODEV; } rc = smb_parse_dt(chip); if (rc < 0) { dev_err(&client->dev, "Unable to parse DT nodes\n"); return rc; } i2c_set_clientdata(client, chip); rc = smb135x_chip_version_and_revision(chip); Loading