Content-Type: multipart/mixed; boundary="===============1582488422790201820==" MIME-Version: 1.0 From: Thomas Weißschuh To: kbuild-all@lists.01.org Subject: [PATCH] power: supply: Provide stubs for charge_behaviour helpers Date: Sat, 08 Jan 2022 16:31:58 +0100 Message-ID: <20220108153158.189489-1-linux@weissschuh.net> In-Reply-To: <487dd7a3-8f29-de9a-2612-65fe895e676f@redhat.com> List-Id: --===============1582488422790201820== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable When CONFIG_SYSFS is not enabled provide stubs for the helper functions to not break their callers. Fixes: 539b9c94ac83 ("power: supply: add helpers for charge_behaviour sysfs= ") Reported-by: kernel test robot Signed-off-by: Thomas Wei=C3=9Fschuh --- include/linux/power_supply.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index d92de670d6a7..e218041cc000 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -723,6 +723,21 @@ ssize_t power_supply_charge_behaviour_show(struct devi= ce *dev, char *buf); = int power_supply_charge_behaviour_parse(unsigned int available_behaviours,= const char *buf); +#else +static inline +ssize_t power_supply_charge_behaviour_show(struct device *dev, + unsigned int available_behaviours, + enum power_supply_charge_behaviour behaviour, + char *buf) +{ + return -EOPNOTSUPP; +} + +static inline int power_supply_charge_behaviour_parse(unsigned int availab= le_behaviours, + const char *buf) +{ + return -EOPNOTSUPP; +} #endif = #endif /* __LINUX_POWER_SUPPLY_H__ */ base-commit: b8170452cd5121b11a5726e3ea8dbdfc2d74e771 -- = 2.34.1 --===============1582488422790201820==--