mirror of https://github.com/torvalds/linux.git
misc: hisi_hikey_usb: Use str_enabled_disabled() in hub_power_ctrl()
Remove hard-coded strings by using the str_enabled_disabled() helper function and silence the following Coccinelle/coccicheck warning reported by string_choices.cocci: opportunity for str_enabled_disabled(value) Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Acked-by: John Stultz <jstultz@google.com> Link: https://lore.kernel.org/r/20250813180108.209096-2-thorsten.blum@linux.dev Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
82bfe76853
commit
89fb7d737f
|
|
@ -18,6 +18,7 @@
|
||||||
#include <linux/property.h>
|
#include <linux/property.h>
|
||||||
#include <linux/regulator/consumer.h>
|
#include <linux/regulator/consumer.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
|
#include <linux/string_choices.h>
|
||||||
#include <linux/usb/role.h>
|
#include <linux/usb/role.h>
|
||||||
|
|
||||||
#define DEVICE_DRIVER_NAME "hisi_hikey_usb"
|
#define DEVICE_DRIVER_NAME "hisi_hikey_usb"
|
||||||
|
|
@ -67,7 +68,7 @@ static void hub_power_ctrl(struct hisi_hikey_usb *hisi_hikey_usb, int value)
|
||||||
if (ret)
|
if (ret)
|
||||||
dev_err(hisi_hikey_usb->dev,
|
dev_err(hisi_hikey_usb->dev,
|
||||||
"Can't switch regulator state to %s\n",
|
"Can't switch regulator state to %s\n",
|
||||||
value ? "enabled" : "disabled");
|
str_enabled_disabled(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void usb_switch_ctrl(struct hisi_hikey_usb *hisi_hikey_usb,
|
static void usb_switch_ctrl(struct hisi_hikey_usb *hisi_hikey_usb,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue