Skip to content

Commit

Permalink
mtd: m25p80: get rid of spi_get_device_id
Browse files Browse the repository at this point in the history
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 <zajec5@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
  • Loading branch information
Rafał Miłecki authored and Brian Norris committed Oct 17, 2014
1 parent 8b3d58e commit 90e55b3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/mtd/devices/m25p80.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ static int m25p_probe(struct spi_device *spi)
struct m25p *flash;
struct spi_nor *nor;
enum read_mode mode = SPI_NOR_NORMAL;
char *flash_name = NULL;
int ret;

data = dev_get_platdata(&spi->dev);
Expand Down Expand Up @@ -236,12 +237,11 @@ static int m25p_probe(struct spi_device *spi)
* If that's the case, respect "type" and ignore a "name".
*/
if (data && data->type)
id = spi_nor_match_id(data->type);

/* If we didn't get name from platform, simply use "modalias". */
if (!id)
id = spi_get_device_id(spi);
flash_name = data->type;
else
flash_name = spi->modalias;

id = spi_nor_match_id(flash_name);
ret = spi_nor_scan(nor, id, mode);
if (ret)
return ret;
Expand Down

0 comments on commit 90e55b3

Please sign in to comment.