OSDN Git Service

power: supply: core: Move psy_has_property() to fix build
authorGeert Uytterhoeven <geert+renesas@glider.be>
Tue, 28 Sep 2021 12:00:19 +0000 (14:00 +0200)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Thu, 30 Sep 2021 10:48:36 +0000 (12:48 +0200)
commit5ce39985c60418579fab1d4ee81427d12bf9e64f
treefbe672fe25349587f44e5f90fd1bea0233b8aa6d
parent9ba533eb99bb2acf8b2268c6f48dcf73e1e47753
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>
drivers/power/supply/power_supply_core.c