aboutsummaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/fm/fm.c4
-rw-r--r--drivers/net/pfe_eth/pfe_firmware.c19
-rw-r--r--drivers/net/sni_netsec.c6
3 files changed, 8 insertions, 21 deletions
diff --git a/drivers/net/fm/fm.c b/drivers/net/fm/fm.c
index f8256126405..d0b492b5a1b 100644
--- a/drivers/net/fm/fm.c
+++ b/drivers/net/fm/fm.c
@@ -388,7 +388,7 @@ int fm_init_common(int index, struct ccsr_fman *reg)
/* speed and mode will be read from DT */
ret = spi_flash_probe_bus_cs(CONFIG_SF_DEFAULT_BUS,
- CONFIG_SF_DEFAULT_CS, 0, 0, &new);
+ CONFIG_SF_DEFAULT_CS, &new);
ucode_flash = dev_get_uclass_priv(new);
#else
@@ -475,7 +475,7 @@ int fm_init_common(int index, struct ccsr_fman *reg)
/* speed and mode will be read from DT */
ret = spi_flash_probe_bus_cs(CONFIG_SF_DEFAULT_BUS, CONFIG_SF_DEFAULT_CS,
- 0, 0, &new);
+ &new);
ucode_flash = dev_get_uclass_priv(new);
#else
diff --git a/drivers/net/pfe_eth/pfe_firmware.c b/drivers/net/pfe_eth/pfe_firmware.c
index 6669048181e..82a4aa89a4d 100644
--- a/drivers/net/pfe_eth/pfe_firmware.c
+++ b/drivers/net/pfe_eth/pfe_firmware.c
@@ -172,31 +172,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_LS_PFE_FW_LENGTH);
if (!addr)
return -ENOMEM;
- ret = spi_flash_probe_bus_cs(CONFIG_SYS_FSL_PFE_SPI_BUS,
- CONFIG_SYS_FSL_PFE_SPI_CS,
- CONFIG_SYS_FSL_PFE_SPI_MAX_HZ,
- CONFIG_SYS_FSL_PFE_SPI_MODE,
- &new);
- if (ret) {
- printf("SF: failed to probe spi\n");
- free(addr);
- device_remove(new, DM_REMOVE_NORMAL);
- return ret;
- }
-
+ pfe_flash = spi_flash_probe(CONFIG_SYS_FSL_PFE_SPI_BUS,
+ CONFIG_SYS_FSL_PFE_SPI_CS,
+ CONFIG_SYS_FSL_PFE_SPI_MAX_HZ,
+ CONFIG_SYS_FSL_PFE_SPI_MODE);
- pfe_flash = dev_get_uclass_priv(new);
if (!pfe_flash) {
printf("SF: probe for pfe failed\n");
free(addr);
- device_remove(new, DM_REMOVE_NORMAL);
return -ENODEV;
}
diff --git a/drivers/net/sni_netsec.c b/drivers/net/sni_netsec.c
index 24caacf8470..9780f2092bd 100644
--- a/drivers/net/sni_netsec.c
+++ b/drivers/net/sni_netsec.c
@@ -621,12 +621,10 @@ static int netsec_stop_gmac(struct netsec_priv *priv)
static void netsec_spi_read(char *buf, loff_t len, loff_t offset)
{
- struct udevice *new;
struct spi_flash *flash;
- spi_flash_probe_bus_cs(CONFIG_SF_DEFAULT_BUS, CONFIG_SF_DEFAULT_CS,
- CONFIG_SF_DEFAULT_SPEED, CONFIG_SF_DEFAULT_MODE, &new);
- flash = dev_get_uclass_priv(new);
+ flash = spi_flash_probe(CONFIG_SF_DEFAULT_BUS, CONFIG_SF_DEFAULT_CS,
+ CONFIG_SF_DEFAULT_SPEED, CONFIG_SF_DEFAULT_MODE);
spi_flash_read(flash, offset, len, buf);
}