linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Thomas Weißschuh" <linux@weissschuh.net>
To: Hans de Goede <hdegoede@redhat.com>, Sebastian Reichel <sre@kernel.org>
Cc: "Thomas Weißschuh" <linux@weissschuh.net>,
	kbuild-all@lists.01.org,
	"Linux Memory Management List" <linux-mm@kvack.org>,
	"Thomas Koch" <linrunner@gmx.net>,
	"Nicolò Piazzalunga" <nicolopiazzalunga@gmail.com>,
	linux-pm@vger.kernel.org, "kernel test robot" <lkp@intel.com>
Subject: [PATCH] power: supply: Provide stubs for charge_behaviour helpers
Date: Sat,  8 Jan 2022 16:31:58 +0100	[thread overview]
Message-ID: <20220108153158.189489-1-linux@weissschuh.net> (raw)
In-Reply-To: <487dd7a3-8f29-de9a-2612-65fe895e676f@redhat.com>

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 <lkp@intel.com>
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 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 device *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 available_behaviours,
+						      const char *buf)
+{
+	return -EOPNOTSUPP;
+}
 #endif
 
 #endif /* __LINUX_POWER_SUPPLY_H__ */

base-commit: b8170452cd5121b11a5726e3ea8dbdfc2d74e771
-- 
2.34.1



  reply	other threads:[~2022-01-08 15:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-07 20:08 [linux-next:master 8287/11475] drivers/platform/x86/thinkpad_acpi.c:9600:9: error: implicit declaration of function 'power_supply_charge_behaviour_show' kernel test robot
2022-01-08 10:24 ` Hans de Goede
2022-01-08 15:31   ` Thomas Weißschuh [this message]
2022-01-08 15:58     ` [PATCH] power: supply: Provide stubs for charge_behaviour helpers Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220108153158.189489-1-linux@weissschuh.net \
    --to=linux@weissschuh.net \
    --cc=hdegoede@redhat.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linrunner@gmx.net \
    --cc=linux-mm@kvack.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=nicolopiazzalunga@gmail.com \
    --cc=sre@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox