diff mbox

[1/2] mtd: m25p80: get rid of spi_get_device_id

Message ID 1411984074-3850-1-git-send-email-zajec5@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Rafał Miłecki Sept. 29, 2014, 9:47 a.m. UTC
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(-)

Comments

Mark Brown Oct. 1, 2014, 6:20 p.m. UTC | #1
On Mon, Sep 29, 2014 at 11:47:53AM +0200, Rafa? Mi?ecki wrote:
> This simplifies the way we use spi_nor framework and will allow us to
> drop spi_nor_match_id.

Please don't CC linux-spi on spi-nor patches that don't have SPI level
changes, it just clogs up patchwork.
Brian Norris Oct. 1, 2014, 6:43 p.m. UTC | #2
On Wed, Oct 01, 2014 at 07:20:03PM +0100, Mark Brown wrote:
> On Mon, Sep 29, 2014 at 11:47:53AM +0200, Rafa? Mi?ecki wrote:
> > This simplifies the way we use spi_nor framework and will allow us to
> > drop spi_nor_match_id.
> 
> Please don't CC linux-spi on spi-nor patches that don't have SPI level
> changes, it just clogs up patchwork.

+1 from me. I appreciate the converse, as I don't need unrelated noise
on linux-mtd.

(I feel sorry for people over at linux-arm-kernel and devicetree, since
they get CC'd on a large variety of unrelated things, it seems. I'm sure
the firehose gets to be almost as bad as LKML sometimes.)

Brian
Rafał Miłecki Oct. 1, 2014, 7:24 p.m. UTC | #3
On 1 October 2014 20:43, Brian Norris <computersforpeace@gmail.com> wrote:
> On Wed, Oct 01, 2014 at 07:20:03PM +0100, Mark Brown wrote:
>> On Mon, Sep 29, 2014 at 11:47:53AM +0200, Rafa? Mi?ecki wrote:
>> > This simplifies the way we use spi_nor framework and will allow us to
>> > drop spi_nor_match_id.
>>
>> Please don't CC linux-spi on spi-nor patches that don't have SPI level
>> changes, it just clogs up patchwork.
>
> +1 from me. I appreciate the converse, as I don't need unrelated noise
> on linux-mtd.
>
> (I feel sorry for people over at linux-arm-kernel and devicetree, since
> they get CC'd on a large variety of unrelated things, it seems. I'm sure
> the firehose gets to be almost as bad as LKML sometimes.)

Sorry, I usually don't. AFAIR this time I copied receivers list from
the original Ben patch / discussion about auto loading.
Brian Norris Oct. 17, 2014, 4:30 p.m. UTC | #4
On Mon, Sep 29, 2014 at 11:47:53AM +0200, Rafa? Mi?ecki wrote:
> 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>

Applied to l2-mtd.git/master.

Brian
diff mbox

Patch

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;