]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
input: cpcap_pwrbutton: set default keycode fallback
authorSvyatoslav Ryhel <clamor95@gmail.com>
Sat, 7 Feb 2026 18:26:21 +0000 (20:26 +0200)
committerSvyatoslav Ryhel <clamor95@gmail.com>
Sun, 22 Mar 2026 12:58:58 +0000 (14:58 +0200)
Set a default fallback value if no keycode is defined

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
drivers/input/cpcap_pwrbutton.c

index c8ad39d33ca990ec61efa08599eae48150a27f11..c52c0481f6732cdc965f9f02bc372594f990e406 100644 (file)
@@ -87,9 +87,7 @@ static int cpcap_pwrbutton_of_to_plat(struct udevice *dev)
        priv->bank = irq_desc / 16;
        priv->id = irq_desc % 16;
 
-       ret = dev_read_u32(dev, "linux,code", &priv->keycode);
-       if (ret)
-               return ret;
+       priv->keycode = dev_read_u32_default(dev, "linux,code", KEY_POWER);
 
        priv->old_state = false;
        priv->skip = false;