Skip to content

Commit 7ac7030

Browse files
tititiou36rafaeljw
authored andcommitted
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>
1 parent b55eef5 commit 7ac7030

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/powercap/powercap_sys.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <linux/module.h>
88
#include <linux/device.h>
99
#include <linux/err.h>
10+
#include <linux/kstrtox.h>
1011
#include <linux/slab.h>
1112
#include <linux/powercap.h>
1213

@@ -446,7 +447,7 @@ static ssize_t enabled_store(struct device *dev,
446447
{
447448
bool mode;
448449

449-
if (strtobool(buf, &mode))
450+
if (kstrtobool(buf, &mode))
450451
return -EINVAL;
451452
if (dev->parent) {
452453
struct powercap_zone *power_zone = to_powercap_zone(dev);

0 commit comments

Comments
 (0)