From patchwork Fri Aug 16 07:37:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Nosthoff X-Patchwork-Id: 11096999 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 045761398 for ; Fri, 16 Aug 2019 07:37:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E25C7289B6 for ; Fri, 16 Aug 2019 07:37:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D645C289D6; Fri, 16 Aug 2019 07:37:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3CCA6289D2 for ; Fri, 16 Aug 2019 07:37:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726604AbfHPHht (ORCPT ); Fri, 16 Aug 2019 03:37:49 -0400 Received: from mail.heine.tech ([195.201.24.99]:35768 "EHLO mail.heine.tech" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725829AbfHPHht (ORCPT ); Fri, 16 Aug 2019 03:37:49 -0400 Received: from localhost (localhost [127.0.0.1]) (Authenticated sender: michael@nosthoff.rocks) by mail.heine.tech (Postcow) with ESMTPSA id 624EA1814A1; Fri, 16 Aug 2019 09:37:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heine.so; s=dkim; t=1565941067; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=LoEZ6U0CLaUCuEgq+DdJEavhnFNLMhxnereXFUUd7+w=; b=ADHJBtUvJpCVa2gkdsCEqh2PXmwgnxP6s3ZS48eyGUo0fVHKJOD+X3RwtgwVUKmrQQMfeS svonZ+ZteWHG3bDBeAWLbLaWxRibglt/JTQlFVV/RefWPkezSVYf7wXUkdLj3R4+AlmdAN zfuwIHZ0iF8/SawqEmc9oHO/kT/ikIg= From: Michael Nosthoff To: linux-pm@vger.kernel.org Cc: Michael Nosthoff , Brian Norris , stable@vger.kernel.org Subject: [PATCH v2] power: supply: sbs-battery: use correct flags field Date: Fri, 16 Aug 2019 09:37:42 +0200 Message-Id: <20190816073742.26866-1-committed@heine.so> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP the type flag is stored in the chip->flags field not in the client->flags field. This currently leads to never using the ti specific health function as client->flags doesn't use that bit. So it's always falling back to the general one. Fixes: 76b16f4cdfb8 ("power: supply: sbs-battery: don't assume MANUFACTURER_DATA formats") Signed-off-by: Michael Nosthoff Reviewed-by: Brian Norris Cc: Reviewed-by: Enric Balletbo i Serra --- Changes since v1: * Changed comment according to Brian's suggestions * Added Fixes tag * Added reviewed and cc stable drivers/power/supply/sbs-battery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/supply/sbs-battery.c b/drivers/power/supply/sbs-battery.c index 048d205d7074..2e86cc1e0e35 100644 --- a/drivers/power/supply/sbs-battery.c +++ b/drivers/power/supply/sbs-battery.c @@ -620,7 +620,7 @@ static int sbs_get_property(struct power_supply *psy, switch (psp) { case POWER_SUPPLY_PROP_PRESENT: case POWER_SUPPLY_PROP_HEALTH: - if (client->flags & SBS_FLAGS_TI_BQ20Z75) + if (chip->flags & SBS_FLAGS_TI_BQ20Z75) ret = sbs_get_ti_battery_presence_and_health(client, psp, val); else