summaryrefslogtreecommitdiff
path: root/drivers/button/button-uclass.c
diff options
context:
space:
mode:
authorCaleb Connolly <caleb.connolly@linaro.org>2025-03-31 14:23:23 +0200
committerCaleb Connolly <caleb.connolly@linaro.org>2025-04-11 15:28:14 +0200
commit9c607005c51976b5e0301461bfc0f38d5bdebd0e (patch)
tree944da6406b12fce006e7a310099e02ffa76f2038 /drivers/button/button-uclass.c
parent8f5685d5d32f50e8a3634686218e3fd143075d93 (diff)
button: make button_get_by_label() case insensitive
This function is already doing a fuzzy match, since there are no guarantees that a given label is unique. Ignoring case makes it much easier to catch "Volume down" or "Volume Down" in board-agnostic code. Tested-by: Danila Tikhonov <danila@jiaxyga.com> # google-sunfish Tested-by: Jens Reidel <adrian@mainlining.org> # xiaomi-davinci Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://lore.kernel.org/r/20250331-qcom-phones-v4-6-f52e57d3b8c6@linaro.org Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Diffstat (limited to 'drivers/button/button-uclass.c')
-rw-r--r--drivers/button/button-uclass.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/button/button-uclass.c b/drivers/button/button-uclass.c
index 729983d5870..025917887e8 100644
--- a/drivers/button/button-uclass.c
+++ b/drivers/button/button-uclass.c
@@ -21,7 +21,7 @@ int button_get_by_label(const char *label, struct udevice **devp)
struct button_uc_plat *uc_plat = dev_get_uclass_plat(dev);
/* Ignore the top-level button node */
- if (uc_plat->label && !strcmp(label, uc_plat->label))
+ if (uc_plat->label && !strcasecmp(label, uc_plat->label))
return uclass_get_device_tail(dev, 0, devp);
}