Re: [PATCH v2 13/15] spi: Rename SPI_MASTER_GPIO_SS to SPI_CONTROLLER_GPIO_SS

Serge Semin
2023-07-11T12:30:45Z

On Mon, Jul 10, 2023 at 06:49:30PM +0300, Andy Shevchenko wrote:
> Rename SPI_MASTER_GPIO_SS to SPI_CONTROLLER_GPIO_SS and
> convert the users to SPI_CONTROLLER_GPIO_SS to follow

* I'm not an expert in English, but imo the next would look a
* bit more readable:
* convert s/the users to SPI_CONTROLLER_GPIO_SS/the code to using SPI_CONTROLLER_GPIO_SS

> the new naming shema.

s/shema/schema

>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
[...]

> drivers/spi/spi-dw-core.c | 2 +-

[...]

> diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c
> index a8ba41ad4541..45f5acc26b1d 100644
> --- a/drivers/spi/spi-dw-core.c
> +++ b/drivers/spi/spi-dw-core.c
> @@ -932,7 +932,7 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws)
> if (dws->mem_ops.exec_op)
> master->mem_ops = &dws->mem_ops;
> master->max_speed_hz = dws->max_freq;
> - master->flags = SPI_MASTER_GPIO_SS;
> + master->flags = SPI_CONTROLLER_GPIO_SS;
> master->auto_runtime_pm = true;
>
> /* Get default rx sample delay */

For the DW APB/AHB SSI driver:
Reviewed-by: Serge Semin <fancer.lancer@gmail.com>

-Serge(y)

[...]

> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
> index 06a92a3a5746..bcabae98cb7c 100644
> --- a/drivers/spi/spi.c
> +++ b/drivers/spi/spi.c
> @@ -995,7 +995,7 @@ static void spi_set_cs(struct spi_device *spi, bool enable, bool force)
> gpiod_set_value_cansleep(spi_get_csgpiod(spi, 0), activate);
> }
> /* Some SPI masters need both GPIO CS & slave_select */
> - if ((spi->controller->flags & SPI_MASTER_GPIO_SS) &&
> + if ((spi->controller->flags & SPI_CONTROLLER_GPIO_SS) &&
> spi->controller->set_cs)
> spi->controller->set_cs(spi, !enable);
> } else if (spi->controller->set_cs) {
> @@ -3020,7 +3020,7 @@ static int spi_get_gpio_descs(struct spi_controller *ctlr)
>
> ctlr->unused_native_cs = ffs(~native_cs_mask) - 1;
>
> - if ((ctlr->flags & SPI_MASTER_GPIO_SS) && num_cs_gpios &&
> + if ((ctlr->flags & SPI_CONTROLLER_GPIO_SS) && num_cs_gpios &&
> ctlr->max_native_cs && ctlr->unused_native_cs >= ctlr->max_native_cs) {
> dev_err(dev, "No unused native chip select available\n");
> return -EINVAL;
> diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
> index cdc3addfe117..43f6c3f71a76 100644
> --- a/include/linux/spi/spi.h
> +++ b/include/linux/spi/spi.h
> @@ -578,8 +578,7 @@ struct spi_controller {
> #define SPI_CONTROLLER_NO_TX BIT(2) /* Can't do buffer write */
> #define SPI_CONTROLLER_MUST_RX BIT(3) /* Requires rx */
> #define SPI_CONTROLLER_MUST_TX BIT(4) /* Requires tx */
> -
> -#define SPI_MASTER_GPIO_SS BIT(5) /* GPIO CS must select slave */
> +#define SPI_CONTROLLER_GPIO_SS BIT(5) /* GPIO CS must select slave */
>
> /* Flag indicating if the allocation of this struct is devres-managed */
> bool devm_allocated;
> --
> 2.40.0.1.gaa8946217a0b
>