powercap: Use kstrtobool() instead of strtobool()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Tue, 1 Nov 2022 21:14:02 +0000 (22:14 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 3 Nov 2022 18:38:16 +0000 (19:38 +0100)
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>
drivers/powercap/powercap_sys.c

index f0654a932b3726e0f5174b07c29ba85de2d672b9..1f968353d47994f3ab421f6c614ddda9d5c41434 100644 (file)
@@ -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);