xhci: dbc: Convert to use sysfs_streq()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 1 Dec 2023 15:06:30 +0000 (17:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Dec 2023 06:50:39 +0000 (07:50 +0100)
It's standard approach to parse values from user space by using
sysfs_streq(). Make driver use it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20231201150647.1307406-3-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-dbgcap.c

index 9e9ce37118133ad23537626e8050b522ca0c8061..f505b79afe531c2f749a527d7ee7201f6468ec4e 100644 (file)
@@ -957,9 +957,9 @@ static ssize_t dbc_store(struct device *dev,
        xhci = hcd_to_xhci(dev_get_drvdata(dev));
        dbc = xhci->dbc;
 
-       if (!strncmp(buf, "enable", 6))
+       if (sysfs_streq(buf, "enable"))
                xhci_dbc_start(dbc);
-       else if (!strncmp(buf, "disable", 7))
+       else if (sysfs_streq(buf, "disable"))
                xhci_dbc_stop(dbc);
        else
                return -EINVAL;