Re: [PATCH v3 3/4] dt-bindings: input: Convert TI TPS65217 power button to DT schema

[email protected] Tue, 21 Jul 2026 11:34:07 +0000
Newsgroups org.kernel.vger.linux-leds,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-input
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

Pre-existing issues:
- [High] Missing NULL check on `dev_get_regmap` can lead to a kernel panic in the IRQ handler.
- [High] The driver incorrectly masks `platform_get_irq()` error codes with `-EINVAL`, breaking probe deferral.
--

--- Patch [3]: [PATCH v3 3/4] dt-bindings: input: Convert TI TPS65217 power button to DT schema ---
commit 7ffa82f06e0d099b257abd8ec45ed224af6ff3c6
Author: Eduard Bostina <[email protected]>

dt-bindings: input: Convert TI TPS65217 power button to DT schema

Convert the Texas Instruments TPS65217 and TPS65218 Power Button
bindings to DT schema.

drivers/input/misc/tps65218-pwrbutton.c:tps6521x_pb_probe() {
        ...
        pwr->regmap = dev_get_regmap(dev->parent, NULL);
        ...
}

[Severity: High]
This isn't a bug introduced by this patch, but does this code need to check
if pwr->regmap is NULL?

If dev_get_regmap() returns NULL due to an incomplete device tree, it seems
this could lead to a kernel panic during an interrupt when tps6521x_pb_irq()
dereferences it:

drivers/input/misc/tps65218-pwrbutton.c:tps6521x_pb_irq() {
        ...
        error = regmap_read(pwr->regmap, tps_data->reg_status, &reg);
        ...
}


drivers/input/misc/tps65218-pwrbutton.c:tps6521x_pb_probe() {
        ...
        irq = platform_get_irq(pdev, 0);
        if (irq < 0)
                return -EINVAL;
        ...
}

[Severity: High]
This is also a pre-existing issue, but does masking the return value of
platform_get_irq() break probe deferral?

If platform_get_irq() returns -EPROBE_DEFER, converting the error to -EINVAL
prevents the driver core from handling the deferral and retrying later.

> diff --git a/Documentation/devicetree/bindings/input/ti,tps65217-pwrbutton.yaml b/Documentation/devicetree/bindings/input/ti,tps65217-pwrbutton.yaml
> new file mode 100644
> index 0000000000000..3526d8b045fd2
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/input/ti,tps65217-pwrbutton.yaml

[ ... ]

-- 
Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=3