]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Input: ads7846 - fix gpiod allocation
authorH. Nikolaus Schaller <hns@goldelico.com>
Sat, 1 Feb 2025 11:43:24 +0000 (12:43 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 Mar 2025 19:54:21 +0000 (12:54 -0700)
commit c9ccb88f534ca760d06590b67571c353a2f0cbcd upstream.

commit 767d83361aaa ("Input: ads7846 - Convert to use software nodes")

has simplified the code but accidentially converted a devm_gpiod_get()
to gpiod_get(). This leaves the gpio reserved on module remove and the
driver can no longer be loaded again.

Fixes: 767d83361aaa ("Input: ads7846 - Convert to use software nodes")
Cc: stable@vger.kernel.org
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Link: https://lore.kernel.org/r/6e9b143f19cdfda835711a8a7a3966e5a2494cff.1738410204.git.hns@goldelico.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/input/touchscreen/ads7846.c

index 607f18af70104dec7490fd76dcbbbcfd04297d71..212dafa0bba2d1a191ac7464555cf9cc0afca5dc 100644 (file)
@@ -1011,7 +1011,7 @@ static int ads7846_setup_pendown(struct spi_device *spi,
        if (pdata->get_pendown_state) {
                ts->get_pendown_state = pdata->get_pendown_state;
        } else {
-               ts->gpio_pendown = gpiod_get(&spi->dev, "pendown", GPIOD_IN);
+               ts->gpio_pendown = devm_gpiod_get(&spi->dev, "pendown", GPIOD_IN);
                if (IS_ERR(ts->gpio_pendown)) {
                        dev_err(&spi->dev, "failed to request pendown GPIO\n");
                        return PTR_ERR(ts->gpio_pendown);