]> Git Repo - linux.git/blobdiff - drivers/spi/spi-gpio.c
regmap: mmio: Allow passing an empty config->reg_stride
[linux.git] / drivers / spi / spi-gpio.c
index 9c8c7948044ed784017100aae497c0b5be35b0c7..092afc7679d4071edced902bbde9c32545820d4a 100644 (file)
@@ -230,7 +230,7 @@ static void spi_gpio_chipselect(struct spi_device *spi, int is_active)
 
        /* Drive chip select line, if we have one */
        if (spi_gpio->cs_gpios) {
-               struct gpio_desc *cs = spi_gpio->cs_gpios[spi->chip_select];
+               struct gpio_desc *cs = spi_gpio->cs_gpios[spi_get_chipselect(spi, 0)];
 
                /* SPI chip selects are normally active-low */
                gpiod_set_value_cansleep(cs, (spi->mode & SPI_CS_HIGH) ? is_active : !is_active);
@@ -248,7 +248,7 @@ static int spi_gpio_setup(struct spi_device *spi)
         * initialized from the descriptor lookup.
         */
        if (spi_gpio->cs_gpios) {
-               cs = spi_gpio->cs_gpios[spi->chip_select];
+               cs = spi_gpio->cs_gpios[spi_get_chipselect(spi, 0)];
                if (!spi->controller_state && cs)
                        status = gpiod_direction_output(cs,
                                                  !(spi->mode & SPI_CS_HIGH));
This page took 0.032551 seconds and 4 git commands to generate.