linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mtd: m25p80: get rid of spi_get_device_id
@ 2014-09-29  9:47 Rafał Miłecki
  2014-09-29  9:47 ` [PATCH 2/2] mtd: spi-nor: make spi_nor_scan() take a chip type name, not spi_device_id Rafał Miłecki
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Rafał Miłecki @ 2014-09-29  9:47 UTC (permalink / raw)
  To: linux-arm-kernel

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>
---
 drivers/mtd/devices/m25p80.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index dcda628..822209d 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)
 	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);
@@ -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;
-- 
1.8.4.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-10-17 16:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-29  9:47 [PATCH 1/2] mtd: m25p80: get rid of spi_get_device_id Rafał Miłecki
2014-09-29  9:47 ` [PATCH 2/2] mtd: spi-nor: make spi_nor_scan() take a chip type name, not spi_device_id Rafał Miłecki
2014-10-17 16:31   ` Brian Norris
2014-10-01 18:20 ` [PATCH 1/2] mtd: m25p80: get rid of spi_get_device_id Mark Brown
2014-10-01 18:43   ` Brian Norris
2014-10-01 19:24     ` Rafał Miłecki
2014-10-17 16:30 ` Brian Norris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).