summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2022-11-01 22:14:02 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2022-11-03 19:38:16 +0100
commit7ac70300f386a5f7d00f66ccc46ed30576b68ef4 (patch)
treedf8912ecbfaee1a116c10bcbeaa1ea7a1caadaab
parentb55eef5226b71edf5422de246bc189da1fdc9000 (diff)
downloadlinux-7ac70300f386a5f7d00f66ccc46ed30576b68ef4.tar.gz
linux-7ac70300f386a5f7d00f66ccc46ed30576b68ef4.tar.bz2
linux-7ac70300f386a5f7d00f66ccc46ed30576b68ef4.zip
powercap: Use kstrtobool() instead of strtobool()
strtobool() is the same as kstrtobool(). However, the latter is more used within the kernel. In order to remove strtobool() and slightly simplify kstrtox.h, switch to the other function name. While at it, include the corresponding header file (<linux/kstrtox.h>) Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/powercap/powercap_sys.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/powercap/powercap_sys.c b/drivers/powercap/powercap_sys.c
index f0654a932b37..1f968353d479 100644
--- a/drivers/powercap/powercap_sys.c
+++ b/drivers/powercap/powercap_sys.c
@@ -7,6 +7,7 @@
#include <linux/module.h>
#include <linux/device.h>
#include <linux/err.h>
+#include <linux/kstrtox.h>
#include <linux/slab.h>
#include <linux/powercap.h>
@@ -446,7 +447,7 @@ static ssize_t enabled_store(struct device *dev,
{
bool mode;
- if (strtobool(buf, &mode))
+ if (kstrtobool(buf, &mode))
return -EINVAL;
if (dev->parent) {
struct powercap_zone *power_zone = to_powercap_zone(dev);