]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
spi: s3c64xx: get rid of the OF alias ID dependency
authorTudor Ambarus <tudor.ambarus@linaro.org>
Fri, 16 Feb 2024 07:05:52 +0000 (07:05 +0000)
committerMark Brown <broonie@kernel.org>
Tue, 5 Mar 2024 20:42:57 +0000 (20:42 +0000)
Compatibles that set ``port_conf->{rx, tx}_fifomask`` are now safe to
get rid of the OF alias ID dependency. Let the driver probe even without
the alias for these.

With this we also protect the FIFO_LVL_MASK calls from
s3c64xx_spi_set_fifomask().

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

index 40de325bd094a5239c1a26c4b67aff67da502f9a..d2d1c9767145861132038f4f4ecc31cc7090858e 100644 (file)
@@ -1203,8 +1203,12 @@ static inline const struct s3c64xx_spi_port_config *s3c64xx_spi_get_port_config(
 static int s3c64xx_spi_set_port_id(struct platform_device *pdev,
                                   struct s3c64xx_spi_driver_data *sdd)
 {
+       const struct s3c64xx_spi_port_config *port_conf = sdd->port_conf;
        int ret;
 
+       if (port_conf->rx_fifomask && port_conf->tx_fifomask)
+               return 0;
+
        if (pdev->dev.of_node) {
                ret = of_alias_get_id(pdev->dev.of_node, "spi");
                if (ret < 0)