summaryrefslogtreecommitdiff
path: root/drivers/power/supply
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2021-09-28 15:00:19 +0300
committerSebastian Reichel <sebastian.reichel@collabora.com>2021-09-30 13:48:36 +0300
commit5ce39985c60418579fab1d4ee81427d12bf9e64f (patch)
treefbe672fe25349587f44e5f90fd1bea0233b8aa6d /drivers/power/supply
parent9ba533eb99bb2acf8b2268c6f48dcf73e1e47753 (diff)
downloadlinux-5ce39985c60418579fab1d4ee81427d12bf9e64f.tar.xz
power: supply: core: Move psy_has_property() to fix build
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 <geert+renesas@glider.be> Reviewed-by: Matthias Kaehlcke <mka@chromium.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power/supply')
-rw-r--r--drivers/power/supply/power_supply_core.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c
index 75575ea45f21..fc12a4f407f4 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;