net: dsa: microchip: ksz9477: setup SPI mode
authorChristian Eggers <ceggers@arri.de>
Fri, 20 Nov 2020 11:21:06 +0000 (12:21 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 26 Nov 2020 01:53:45 +0000 (17:53 -0800)
This should be done in the device driver instead of the device tree.

Signed-off-by: Christian Eggers <ceggers@arri.de>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/microchip/ksz9477_spi.c

index 1142768..15bc11b 100644 (file)
@@ -48,6 +48,12 @@ static int ksz9477_spi_probe(struct spi_device *spi)
        if (spi->dev.platform_data)
                dev->pdata = spi->dev.platform_data;
 
+       /* setup spi */
+       spi->mode = SPI_MODE_3;
+       ret = spi_setup(spi);
+       if (ret)
+               return ret;
+
        ret = ksz9477_switch_register(dev);
 
        /* Main DSA driver may not be started yet. */