Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4821997pxb; Tue, 28 Sep 2021 05:02:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMGccwDVB6j/iI8S/MKi5g6gDwqVE49Fp7MUBemZm/g3+BK3IwvJdaH6hIhWPp+DyEGLmc X-Received: by 2002:a50:fa89:: with SMTP id w9mr7205484edr.113.1632830555478; Tue, 28 Sep 2021 05:02:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632830555; cv=none; d=google.com; s=arc-20160816; b=hRn3DE8uHpU0OeRvUpxcTblY8yO0GBBYpDXgsELlWvRQ4PYQXrgXVqH3eNpeza2lTf uT+nllfTZJCgxZpy7hlJtVXeJDmb7nRfkwSippBjLupndlk9ktVN6DvLq/EVE9/zr7iq /hS5ncYTTs2kzmWkGdvtZvWgEnb5EqFaA+hAmpZ85povnd5jxGyRzMlzfI1qdphpncth GLnFaK7p3pAKN0B7Tp4KSSQreQsm4DRiGeHebSMZueeZct7hvk2BX/YqzYpOFdjNgOgl dJwZ5q1i2TJyjTQ8bPGh7tki2BYgWaXoEerook0diRwG6N0aiye4cWdcA7/VvANLWsb5 vnYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=LyRECUZ++mRrjPkyHGJ384rGaMo/eDwA7EootI3712c=; b=ckZQLCU9BedquuxVZVBhTbDRFUiDwHYQigYvlEfv0J+dz2NlLxUgJd1dX5OQoMpIdC SZvqcxuuSuc+oEzVc/M/xcdlFrDpNy88ImuijudaWycCRATsJtkiBpEOTeoWOCHj2AOu MBSmgRA6zvJh/CfAVF9JZlNnVmrTHkny765Ly++Ik6iUJPPlNHxAb/FRsAF9phrNSXA3 n/YQtwKk3Txb7fl+0zLry9xdIrJldbr84uw8FoiFN/eVS0XCC+0F5KKg9Bv35Lqzc6TP CLIx4W8eMO7YJF03IwaWlupxOD1U15NMVaQR8VkunxbROyFkG42TqpQEzdGOWBTjtDL7 ym8A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w18si6284266edx.77.2021.09.28.05.02.07; Tue, 28 Sep 2021 05:02:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240453AbhI1MCI (ORCPT + 99 others); Tue, 28 Sep 2021 08:02:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240488AbhI1MCH (ORCPT ); Tue, 28 Sep 2021 08:02:07 -0400 Received: from xavier.telenet-ops.be (xavier.telenet-ops.be [IPv6:2a02:1800:120:4::f00:14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C392CC061575 for ; Tue, 28 Sep 2021 05:00:27 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed30:a9b1:8dc9:da2c:b028]) by xavier.telenet-ops.be with bizsmtp id zQ0Q250023Yhtpx01Q0QgN; Tue, 28 Sep 2021 14:00:24 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1mVBmZ-000JpQ-Kl; Tue, 28 Sep 2021 14:00:23 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1mVBmZ-009dEZ-94; Tue, 28 Sep 2021 14:00:23 +0200 From: Geert Uytterhoeven To: Matthias Kaehlcke , Sebastian Reichel Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] power: supply: core: Move psy_has_property() to fix build Date: Tue, 28 Sep 2021 14:00:19 +0200 Message-Id: <7b35a74f2c2ad19c8dc1ca60c59e48a14288677f.1632830348.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If CONFIG_THERMAL=n: drivers/power/supply/power_supply_core.c: In function ‘__power_supply_register’: drivers/power/supply/power_supply_core.c:1137:6: error: implicit declaration of function ‘psy_has_property’ [-Werror=implicit-function-declaration] 1137 | if (psy_has_property(desc, POWER_SUPPLY_PROP_USB_TYPE) && | ^~~~~~~~~~~~~~~~ Fix this by moving psy_has_property() outside the section protected by CONFIG_THERMAL. Fixes: 9ba533eb99bb2acf ("power: supply: core: Add psy_has_property()") Signed-off-by: Geert Uytterhoeven --- drivers/power/supply/power_supply_core.c | 32 ++++++++++++------------ 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c index 75575ea45f21ddc7..fc12a4f407f431a6 100644 --- a/drivers/power/supply/power_supply_core.c +++ b/drivers/power/supply/power_supply_core.c @@ -951,6 +951,22 @@ void power_supply_unreg_notifier(struct notifier_block *nb) } EXPORT_SYMBOL_GPL(power_supply_unreg_notifier); +static bool psy_has_property(const struct power_supply_desc *psy_desc, + enum power_supply_property psp) +{ + bool found = false; + int i; + + for (i = 0; i < psy_desc->num_properties; i++) { + if (psy_desc->properties[i] == psp) { + found = true; + break; + } + } + + return found; +} + #ifdef CONFIG_THERMAL static int power_supply_read_temp(struct thermal_zone_device *tzd, int *temp) @@ -975,22 +991,6 @@ static struct thermal_zone_device_ops psy_tzd_ops = { .get_temp = power_supply_read_temp, }; -static bool psy_has_property(const struct power_supply_desc *psy_desc, - enum power_supply_property psp) -{ - bool found = false; - int i; - - for (i = 0; i < psy_desc->num_properties; i++) { - if (psy_desc->properties[i] == psp) { - found = true; - break; - } - } - - return found; -} - static int psy_register_thermal(struct power_supply *psy) { int ret; -- 2.25.1