diff options
| -rw-r--r-- | drivers/mtd/devices/m25p80.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index dcda6287228d..822209d10689 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c | |||
| @@ -197,6 +197,7 @@ static int m25p_probe(struct spi_device *spi) | |||
| 197 | struct m25p *flash; | 197 | struct m25p *flash; |
| 198 | struct spi_nor *nor; | 198 | struct spi_nor *nor; |
| 199 | enum read_mode mode = SPI_NOR_NORMAL; | 199 | enum read_mode mode = SPI_NOR_NORMAL; |
| 200 | char *flash_name = NULL; | ||
| 200 | int ret; | 201 | int ret; |
| 201 | 202 | ||
| 202 | data = dev_get_platdata(&spi->dev); | 203 | data = dev_get_platdata(&spi->dev); |
| @@ -236,12 +237,11 @@ static int m25p_probe(struct spi_device *spi) | |||
| 236 | * If that's the case, respect "type" and ignore a "name". | 237 | * If that's the case, respect "type" and ignore a "name". |
| 237 | */ | 238 | */ |
| 238 | if (data && data->type) | 239 | if (data && data->type) |
| 239 | id = spi_nor_match_id(data->type); | 240 | flash_name = data->type; |
| 240 | 241 | else | |
| 241 | /* If we didn't get name from platform, simply use "modalias". */ | 242 | flash_name = spi->modalias; |
| 242 | if (!id) | ||
| 243 | id = spi_get_device_id(spi); | ||
| 244 | 243 | ||
| 244 | id = spi_nor_match_id(flash_name); | ||
| 245 | ret = spi_nor_scan(nor, id, mode); | 245 | ret = spi_nor_scan(nor, id, mode); |
| 246 | if (ret) | 246 | if (ret) |
| 247 | return ret; | 247 | return ret; |
