Re: [PATCH v1 1/1] spi: Don't overwrite num_chipselect with error code

2021-04-20 Thread Andy Shevchenko
On Tue, Apr 20, 2021 at 4:19 PM Andy Shevchenko wrote: > > The code currently organized in a way that num_chipselect is overwritten > each time we call spi_get_gpio_descs(). It might be potentially dangerous > in case when the gpiod_count() returns an error code. > > Note, that gpiod_count()

[PATCH v1 1/1] spi: Don't overwrite num_chipselect with error code

2021-04-20 Thread Andy Shevchenko
The code currently organized in a way that num_chipselect is overwritten each time we call spi_get_gpio_descs(). It might be potentially dangerous in case when the gpiod_count() returns an error code. Note, that gpiod_count() never returns 0, take this into account as well. Fixes: f3186dd87669