spi: s3c64xx: let the SPI core determine the bus number
authorTudor Ambarus <tudor.ambarus@linaro.org>
Fri, 16 Feb 2024 07:05:50 +0000 (07:05 +0000)
committerMark Brown <broonie@kernel.org>
Tue, 5 Mar 2024 20:42:55 +0000 (20:42 +0000)
Let the core determine the bus number, either by getting the alias ID
(as the driver forces now), or by allocating a dynamic bus number when
the alias is absent. Prepare the driver to allow dt aliases to be
absent.

Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Link: https://msgid.link/r/20240216070555.2483977-8-tudor.ambarus@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-s3c64xx.c

index 68f95c04d0922f8a27a473318b1ac101d4fdf377..ac47755beb02dc769c87692eb9e08abeb0c4cf41 100644 (file)
@@ -1279,7 +1279,7 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
        sdd->rx_dma.direction = DMA_DEV_TO_MEM;
 
        host->dev.of_node = pdev->dev.of_node;
-       host->bus_num = sdd->port_id;
+       host->bus_num = -1;
        host->setup = s3c64xx_spi_setup;
        host->cleanup = s3c64xx_spi_cleanup;
        host->prepare_transfer_hardware = s3c64xx_spi_prepare_transfer;
@@ -1360,7 +1360,7 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
        }
 
        dev_dbg(&pdev->dev, "Samsung SoC SPI Driver loaded for Bus SPI-%d with %d Targets attached\n",
-                                       sdd->port_id, host->num_chipselect);
+               host->bus_num, host->num_chipselect);
        dev_dbg(&pdev->dev, "\tIOmem=[%pR]\tFIFO %dbytes\n",
                mem_res, sdd->fifo_depth);