Re: [PATCH v3 04/12] gpiolib: remove gpio_set_debounce

Dmitry Torokhov
2023-02-07T21:32:11Z

On Tue, Feb 07, 2023 at 04:29:44PM +0200, Andy Shevchenko wrote:
> @@ -1010,14 +1009,21 @@ static int ads7846_setup_pendown(struct spi_device *spi,
> }
>
> ts->gpio_pendown = pdata->gpio_pendown;
> -
> - if (pdata->gpio_pendown_debounce)
> - gpio_set_debounce(pdata->gpio_pendown,
> - pdata->gpio_pendown_debounce);

Can we please change only this to:

gpiod_set_debounce(gpio_to_desc(pdata->gpio_pendown),
pdata->gpio_pendown_debounce);

and not change anything else (i.e. drop the changes below)?

> } else {
> - dev_err(&spi->dev, "no get_pendown_state nor gpio_pendown?\n");
> - return -EINVAL;
> + struct gpio_desc *desc;
> +
> + desc = devm_gpiod_get(&spi->dev, "pendown", GPIOD_IN);
> + if (IS_ERR(desc)) {
> + dev_err(&spi->dev, "no get_pendown_state nor gpio_pendown?\n");
> + return PTR_ERR(desc);
> + }
> + gpiod_set_consumer_name(desc, "ads7846_pendown");
> +
> + ts->gpio_pendown = desc_to_gpio(desc);
> }
> + if (pdata->gpio_pendown_debounce)
> + gpiod_set_debounce(gpio_to_desc(ts->gpio_pendown),
> + pdata->gpio_pendown_debounce);
>
> return 0;

Thanks.

--
Dmitry