X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fmtd%2Fspi%2Fsf_probe.c;h=7b296378d2be4fa20a274219a63ae93fee95eae4;hb=b4a6c2aae6165782dd9fa4944b38c2c2a7419af1;hp=0cafc291230c2aba8a76576d242b158e73dbd4fa;hpb=5076c64a08d2083af5a7761b12a30116ef0da967;p=oweals%2Fu-boot.git diff --git a/drivers/mtd/spi/sf_probe.c b/drivers/mtd/spi/sf_probe.c index 0cafc29123..7b296378d2 100644 --- a/drivers/mtd/spi/sf_probe.c +++ b/drivers/mtd/spi/sf_probe.c @@ -42,10 +42,8 @@ static int spi_flash_probe_slave(struct spi_flash *flash) } ret = spi_flash_scan(flash); - if (ret) { - ret = -EINVAL; + if (ret) goto err_read_id; - } #ifdef CONFIG_SPI_FLASH_MTD ret = spi_flash_mtd_register(flash); @@ -128,7 +126,7 @@ static int spi_flash_std_write(struct udevice *dev, u32 offset, size_t len, #if defined(CONFIG_SPI_FLASH_SST) if (flash->flags & SNOR_F_SST_WR) { - if (flash->spi->op_mode_tx & SPI_OPM_TX_BP) + if (flash->spi->mode & SPI_TX_BYTE) return sst_write_bp(flash, offset, len, buf); else return sst_write_wp(flash, offset, len, buf);