]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: pfe_eth: Remove non-DM code check from pfe_spi_flash_init
authorKuldeep Singh <kuldeep.singh@nxp.com>
Fri, 11 Sep 2020 11:06:49 +0000 (16:36 +0530)
committerPriyanka Jain <priyanka.jain@nxp.com>
Thu, 24 Sep 2020 15:27:32 +0000 (20:57 +0530)
CONFIG_DM_SPI_FLASH is only supported now with passing of driver
conversion deadline from non-DM to DM model. Hence, it's safe to remove
non-DM code check from pfe_spi_flash_init.

Also use CONFIG_ENV_SPI_MODE and CONFIG_ENV_SPI_MAX_HZ instead of
reading reading values from DT.

Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
drivers/net/pfe_eth/pfe_firmware.c

index 4ad09dda1cf0cfd4e0fd4819070152ce67eade41..d414c750d42313f331797b459744dbc9423dc84a 100644 (file)
@@ -167,26 +167,20 @@ static int pfe_fit_check(void)
 int pfe_spi_flash_init(void)
 {
        struct spi_flash *pfe_flash;
+       struct udevice *new;
        int ret = 0;
        void *addr = malloc(CONFIG_SYS_QE_FMAN_FW_LENGTH);
 
        if (!addr)
                return -ENOMEM;
 
-#ifdef CONFIG_DM_SPI_FLASH
-       struct udevice *new;
-
-       /* speed and mode will be read from DT */
        ret = spi_flash_probe_bus_cs(CONFIG_ENV_SPI_BUS,
-                                    CONFIG_ENV_SPI_CS, 0, 0, &new);
+                                    CONFIG_ENV_SPI_CS,
+                                    CONFIG_ENV_SPI_MAX_HZ,
+                                    CONFIG_ENV_SPI_MODE,
+                                    &new);
 
        pfe_flash = dev_get_uclass_priv(new);
-#else
-       pfe_flash = spi_flash_probe(CONFIG_ENV_SPI_BUS,
-                                   CONFIG_ENV_SPI_CS,
-                                   CONFIG_ENV_SPI_MAX_HZ,
-                                   CONFIG_ENV_SPI_MODE);
-#endif
        if (!pfe_flash) {
                printf("SF: probe for pfe failed\n");
                free(addr);