[PATCH] Input: psxpad-spi - use devm_pm_runtime_enable()
From: Cong Nguyen
Date: Sun Nov 29 2026 - 23:57:32 EST
psxpad_spi_probe() calls pm_runtime_enable(), but the driver has no
remove callback and nothing disables runtime PM on unbind. A later
probe of the same device then calls pm_runtime_enable() with the
disable depth already zero and warns about an unbalanced enable.
Use devm_pm_runtime_enable() so runtime PM is disabled on unbind.
Fixes: 8be193c7b1f4 ("Input: add support for PlayStation 1/2 joypads connected via SPI")
Signed-off-by: Cong Nguyen <congnt264@xxxxxxxxx>
---
drivers/input/joystick/psxpad-spi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/input/joystick/psxpad-spi.c b/drivers/input/joystick/psxpad-spi.c
index a2b00e420e38..3f3c2e27f099 100644
--- a/drivers/input/joystick/psxpad-spi.c
+++ b/drivers/input/joystick/psxpad-spi.c
@@ -374,7 +374,9 @@ static int psxpad_spi_probe(struct spi_device *spi)
}
spi_set_drvdata(spi, pad);
- pm_runtime_enable(&spi->dev);
+ err = devm_pm_runtime_enable(&spi->dev);
+ if (err)
+ return err;
return 0;
}
--
2.25.1