Commit 31ed8eb
spi: Make error handling of gpiod_count() call cleaner
Each time we call spi_get_gpio_descs() the num_chipselect is overwritten
either by new value or by the old one. This is an extra operation in case
gpiod_count() returns an error. Besides that it slashes the error handling
of gpiod_count().
Refactor the code to make error handling of gpiod_count() call cleaner.
Note, that gpiod_count() never returns 0, take this into account as well.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210420164040.40055-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>1 parent 1799bb1 commit 31ed8eb
1 file changed
Lines changed: 7 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2551 | 2551 | | |
2552 | 2552 | | |
2553 | 2553 | | |
2554 | | - | |
2555 | | - | |
2556 | | - | |
2557 | | - | |
2558 | | - | |
2559 | | - | |
| 2554 | + | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
2560 | 2558 | | |
| 2559 | + | |
| 2560 | + | |
| 2561 | + | |
2561 | 2562 | | |
2562 | 2563 | | |
2563 | 2564 | | |
| |||
0 commit comments