Linux Input/HID development
 help / color / mirror / Atom feed
From: Cong Nguyen <congnt264@gmail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] Input: psxpad-spi - use devm_pm_runtime_enable()
Date: Mon, 30 Nov 2026 11:57:14 +0700	[thread overview]
Message-ID: <20261130045714.654571-1-congnt264@gmail.com> (raw)

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@gmail.com>
---
 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


             reply	other threads:[~2026-11-30  4:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30  4:57 Cong Nguyen [this message]
2026-11-30  5:04 ` [PATCH] Input: psxpad-spi - use devm_pm_runtime_enable() sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261130045714.654571-1-congnt264@gmail.com \
    --to=congnt264@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox