spi: davinci: use spi->cs_gpio directly
Use spi->cs_gpio directly to remove the following build warning: drivers/spi/spi-davinci.c:219:6: warning: 'gpio' may be used uninitialized in this function Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Родитель
6ff33f3902
Коммит
8cae042478
|
@ -215,18 +215,10 @@ static void davinci_spi_chipselect(struct spi_device *spi, int value)
|
||||||
struct davinci_spi_config *spicfg = spi->controller_data;
|
struct davinci_spi_config *spicfg = spi->controller_data;
|
||||||
u8 chip_sel = spi->chip_select;
|
u8 chip_sel = spi->chip_select;
|
||||||
u16 spidat1 = CS_DEFAULT;
|
u16 spidat1 = CS_DEFAULT;
|
||||||
bool gpio_chipsel = false;
|
|
||||||
int gpio;
|
|
||||||
|
|
||||||
dspi = spi_master_get_devdata(spi->master);
|
dspi = spi_master_get_devdata(spi->master);
|
||||||
pdata = &dspi->pdata;
|
pdata = &dspi->pdata;
|
||||||
|
|
||||||
if (spi->cs_gpio >= 0) {
|
|
||||||
/* SPI core parse and update master->cs_gpio */
|
|
||||||
gpio_chipsel = true;
|
|
||||||
gpio = spi->cs_gpio;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* program delay transfers if tx_delay is non zero */
|
/* program delay transfers if tx_delay is non zero */
|
||||||
if (spicfg->wdelay)
|
if (spicfg->wdelay)
|
||||||
spidat1 |= SPIDAT1_WDEL;
|
spidat1 |= SPIDAT1_WDEL;
|
||||||
|
@ -235,11 +227,12 @@ static void davinci_spi_chipselect(struct spi_device *spi, int value)
|
||||||
* Board specific chip select logic decides the polarity and cs
|
* Board specific chip select logic decides the polarity and cs
|
||||||
* line for the controller
|
* line for the controller
|
||||||
*/
|
*/
|
||||||
if (gpio_chipsel) {
|
if (spi->cs_gpio >= 0) {
|
||||||
if (value == BITBANG_CS_ACTIVE)
|
if (value == BITBANG_CS_ACTIVE)
|
||||||
gpio_set_value(gpio, spi->mode & SPI_CS_HIGH);
|
gpio_set_value(spi->cs_gpio, spi->mode & SPI_CS_HIGH);
|
||||||
else
|
else
|
||||||
gpio_set_value(gpio, !(spi->mode & SPI_CS_HIGH));
|
gpio_set_value(spi->cs_gpio,
|
||||||
|
!(spi->mode & SPI_CS_HIGH));
|
||||||
} else {
|
} else {
|
||||||
if (value == BITBANG_CS_ACTIVE) {
|
if (value == BITBANG_CS_ACTIVE) {
|
||||||
spidat1 |= SPIDAT1_CSHOLD_MASK;
|
spidat1 |= SPIDAT1_CSHOLD_MASK;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче