X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=drivers%2Fmtd%2Fspi%2Fstmicro.c;h=c5fa64e376cb235a075039eb4bb6f002c1b99d62;hb=53752c90e02031e89ff8f52f85c0da3c982ea70b;hp=0ca00f158c620646194f0c8254dae67d6af2685e;hpb=326ea986ac150acdc7656d57fca647db80b50158;p=u-boot diff --git a/drivers/mtd/spi/stmicro.c b/drivers/mtd/spi/stmicro.c index 0ca00f158c..c5fa64e376 100644 --- a/drivers/mtd/spi/stmicro.c +++ b/drivers/mtd/spi/stmicro.c @@ -8,7 +8,7 @@ * Copyright (C) 2004-2007 Freescale Semiconductor, Inc. * TsiChung Liew (Tsi-Chung.Liew@freescale.com) * - * SPDX-License-Identifier: GPL-2.0+ + * SPDX-License-Identifier: GPL-2.0+ */ #include @@ -18,7 +18,7 @@ #include "spi_flash_internal.h" /* M25Pxx-specific commands */ -#define CMD_M25PXX_RES 0xab /* Release from DP, and Read Signature */ +#define CMD_M25PXX_RES 0xab /* Release from DP, and Read Signature */ struct stmicro_spi_flash_params { u16 id; @@ -150,7 +150,7 @@ static const struct stmicro_spi_flash_params stmicro_spi_flash_table[] = { }, }; -struct spi_flash *spi_flash_probe_stmicro(struct spi_slave *spi, u8 * idcode) +struct spi_flash *spi_flash_probe_stmicro(struct spi_slave *spi, u8 *idcode) { const struct stmicro_spi_flash_params *params; struct spi_flash *flash; @@ -166,17 +166,17 @@ struct spi_flash *spi_flash_probe_stmicro(struct spi_slave *spi, u8 * idcode) idcode[0] = 0x20; idcode[1] = 0x20; idcode[2] = idcode[3] + 1; - } else + } else { return NULL; + } } id = ((idcode[1] << 8) | idcode[2]); for (i = 0; i < ARRAY_SIZE(stmicro_spi_flash_table); i++) { params = &stmicro_spi_flash_table[i]; - if (params->id == id) { + if (params->id == id) break; - } } if (i == ARRAY_SIZE(stmicro_spi_flash_table)) {