Skip to content

Commit 90e55b3

Browse files
rmileckicomputersforpeace
authored andcommitted
mtd: m25p80: get rid of spi_get_device_id
This simplifies the way we use spi_nor framework and will allow us to drop spi_nor_match_id. Signed-off-by: Rafał Miłecki <[email protected]> Signed-off-by: Brian Norris <[email protected]>
1 parent 8b3d58e commit 90e55b3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/mtd/devices/m25p80.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ static int m25p_probe(struct spi_device *spi)
197197
struct m25p *flash;
198198
struct spi_nor *nor;
199199
enum read_mode mode = SPI_NOR_NORMAL;
200+
char *flash_name = NULL;
200201
int ret;
201202

202203
data = dev_get_platdata(&spi->dev);
@@ -236,12 +237,11 @@ static int m25p_probe(struct spi_device *spi)
236237
* If that's the case, respect "type" and ignore a "name".
237238
*/
238239
if (data && data->type)
239-
id = spi_nor_match_id(data->type);
240-
241-
/* If we didn't get name from platform, simply use "modalias". */
242-
if (!id)
243-
id = spi_get_device_id(spi);
240+
flash_name = data->type;
241+
else
242+
flash_name = spi->modalias;
244243

244+
id = spi_nor_match_id(flash_name);
245245
ret = spi_nor_scan(nor, id, mode);
246246
if (ret)
247247
return ret;

0 commit comments

Comments
 (0)