From patchwork Sun Feb 6 18:35:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 540518 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE47AC433FE for ; Sun, 6 Feb 2022 18:36:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235464AbiBFSgD (ORCPT ); Sun, 6 Feb 2022 13:36:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234686AbiBFSgD (ORCPT ); Sun, 6 Feb 2022 13:36:03 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 10E4AC06173B for ; Sun, 6 Feb 2022 10:36:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644172562; 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: in-reply-to:in-reply-to:references:references; bh=gaYyzPY8rVZtuVN9ayumSFX8EOvUvD+OtdVBt+eL/PE=; b=T4O1HDBet0pIKJ67WtRZHIyKg9h3+6YOry6WVNdRxsAT4pkaVmufScNWWcDOxqtwNR/DjZ mtRhr0JAXHrcs2Tzqu2lj2RZBtMow10n/7kas/fZ0hm2OWfBG3A8SviPtGXiAn/OvAgQEh DA8lMUQBkWXKn2CK3yXwjKGUzHDakHY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-274-LlH_Pv5LNF6YwduqPN7VFQ-1; Sun, 06 Feb 2022 13:35:58 -0500 X-MC-Unique: LlH_Pv5LNF6YwduqPN7VFQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F2650801B2E; Sun, 6 Feb 2022 18:35:57 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.192.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0761485EE4; Sun, 6 Feb 2022 18:35:56 +0000 (UTC) From: Hans de Goede To: Sebastian Reichel Cc: Hans de Goede , Stephan Gerhold , linux-pm@vger.kernel.org Subject: [PATCH v2 4/8] power: supply: bq24190_charger: Always call power_supply_get_battery_info() Date: Sun, 6 Feb 2022 19:35:39 +0100 Message-Id: <20220206183543.51200-5-hdegoede@redhat.com> In-Reply-To: <20220206183543.51200-1-hdegoede@redhat.com> References: <20220206183543.51200-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org power_supply_get_battery_info() now also supports getting battery_info on boards not using dt/of. Remove the of_node check. If neither of nor other battery-info is present the function will fail making this change a no-op in that case. Signed-off-by: Hans de Goede --- drivers/power/supply/bq24190_charger.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/power/supply/bq24190_charger.c b/drivers/power/supply/bq24190_charger.c index 7414830a70e4..83873119ba24 100644 --- a/drivers/power/supply/bq24190_charger.c +++ b/drivers/power/supply/bq24190_charger.c @@ -1693,8 +1693,7 @@ static int bq24190_get_config(struct bq24190_dev_info *bdi) dev_warn(bdi->dev, "invalid value for %s: %u\n", s, v); } - if (bdi->dev->of_node && - !power_supply_get_battery_info(bdi->charger, &info)) { + if (!power_supply_get_battery_info(bdi->charger, &info)) { v = info->precharge_current_ua / 1000; if (v >= BQ24190_REG_PCTCC_IPRECHG_MIN && v <= BQ24190_REG_PCTCC_IPRECHG_MAX)