Skip to contentSkip to conversation

ARM: don't set unused name in struct flash_platform_data

PATCH New Rafał Miłecki 3 participants 6 messages Sep 29, 2014 – Oct 22, 2014

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: don't set unused name in struct flash_platform_data

Loading correct SPI driver (m25p80) is handled using modalias from the struct spi_board_info. There is no point of setting name in the platform_data, m25p80 ignores it anyway.

---
 arch/arm/mach-davinci/board-da830-evm.c    | 1 -
 arch/arm/mach-davinci/board-da850-evm.c    | 1 -
 arch/arm/mach-davinci/board-mityomapl138.c | 1 -
 arch/arm/mach-shmobile/board-bockw.c       | 1 -
 arch/arm/mach-shmobile/board-koelsch.c     | 1 -
 arch/arm/mach-shmobile/board-lager.c       | 1 -
 arch/arm/mach-w90x900/dev.c                | 1 -
 7 files changed, 7 deletions(-)
arch/arm/mach-davinci/board-da830-evm.c +0 -1
index 5623131..263004a 100644
@@ -567,7 +567,6 @@ static struct mtd_partition da830evm_spiflash_part[] = {
 };
 
 static struct flash_platform_data da830evm_spiflash_data = {
-	.name		= "m25p80",
 	.parts		= da830evm_spiflash_part,
 	.nr_parts	= ARRAY_SIZE(da830evm_spiflash_part),
 	.type		= "w25x32",
arch/arm/mach-davinci/board-da850-evm.c +0 -1
index 234c5bb..721ff2b 100644
@@ -104,7 +104,6 @@ static struct mtd_partition da850evm_spiflash_part[] = {
 };
 
 static struct flash_platform_data da850evm_spiflash_data = {
-	.name		= "m25p80",
 	.parts		= da850evm_spiflash_part,
 	.nr_parts	= ARRAY_SIZE(da850evm_spiflash_part),
 	.type		= "m25p64",
arch/arm/mach-davinci/board-mityomapl138.c +0 -1
index 96fc00a..3c93b65 100644
@@ -350,7 +350,6 @@ static struct mtd_partition spi_flash_partitions[] = {
 };
 
 static struct flash_platform_data mityomapl138_spi_flash_data = {
-	.name		= "m25p80",
 	.parts		= spi_flash_partitions,
 	.nr_parts	= ARRAY_SIZE(spi_flash_partitions),
 	.type		= "m24p64",
arch/arm/mach-shmobile/board-bockw.c +0 -1
index 8a83eb3..e25af56 100644
@@ -266,7 +266,6 @@ static struct mtd_partition m25p80_spi_flash_partitions[] = {
 };
 
 static struct flash_platform_data spi_flash_data = {
-	.name		= "m25p80",
 	.type		= "s25fl008k",
 	.parts		= m25p80_spi_flash_partitions,
 	.nr_parts	= ARRAY_SIZE(m25p80_spi_flash_partitions),
arch/arm/mach-shmobile/board-koelsch.c +0 -1
index b7d5bc7..a494a00 100644
@@ -207,7 +207,6 @@ static struct mtd_partition spi_flash_part[] = {
 };
 
 static const struct flash_platform_data spi_flash_data = {
-	.name		= "m25p80",
 	.parts		= spi_flash_part,
 	.nr_parts	= ARRAY_SIZE(spi_flash_part),
 	.type		= "s25fl512s",
arch/arm/mach-shmobile/board-lager.c +0 -1
index e1d8215..3575731 100644
@@ -315,7 +315,6 @@ static struct mtd_partition spi_flash_part[] = {
 };
 
 static const struct flash_platform_data spi_flash_data = {
-	.name           = "m25p80",
 	.parts          = spi_flash_part,
 	.nr_parts       = ARRAY_SIZE(spi_flash_part),
 	.type           = "s25fl512s",
arch/arm/mach-w90x900/dev.c +0 -1
index e65a80a..9745a73 100644
@@ -249,7 +249,6 @@ static struct mtd_partition nuc900_spi_flash_partitions[] = {
 };
 
 static struct flash_platform_data nuc900_spi_flash_data = {
-	.name = "m25p80",
 	.parts =  nuc900_spi_flash_partitions,
 	.nr_parts = ARRAY_SIZE(nuc900_spi_flash_partitions),
 	.type = "w25x16",
Signature · 1 line
1.8.4.5
#1 lore raw

PATCH 1/1 ARM: don't set unused name in struct flash_platform_data

Quoted 5 lines · Rafa? Mi?ecki

Loading correct SPI driver (m25p80) is handled using modalias from the struct spi_board_info. There is no point of setting name in the platform_data, m25p80 ignores it anyway.

Quoted 9 lines
---
 arch/arm/mach-davinci/board-da830-evm.c    | 1 -
 arch/arm/mach-davinci/board-da850-evm.c    | 1 -
 arch/arm/mach-davinci/board-mityomapl138.c | 1 -
 arch/arm/mach-shmobile/board-bockw.c       | 1 -
 arch/arm/mach-shmobile/board-koelsch.c     | 1 -
 arch/arm/mach-shmobile/board-lager.c       | 1 -
 arch/arm/mach-w90x900/dev.c                | 1 -
 7 files changed, 7 deletions(-)

Hi,

I am happy to queue up the mach-shmobile portion of this change if you break it out into a separate patch, one per board.

Quoted 93 lines
arch/arm/mach-davinci/board-da830-evm.c +0 -1
index 5623131..263004a 100644
@@ -567,7 +567,6 @@ static struct mtd_partition da830evm_spiflash_part[] = {
 };
 
 static struct flash_platform_data da830evm_spiflash_data = {
-	.name		= "m25p80",
 	.parts		= da830evm_spiflash_part,
 	.nr_parts	= ARRAY_SIZE(da830evm_spiflash_part),
 	.type		= "w25x32",
arch/arm/mach-davinci/board-da850-evm.c +0 -1
index 234c5bb..721ff2b 100644
@@ -104,7 +104,6 @@ static struct mtd_partition da850evm_spiflash_part[] = {
 };
 
 static struct flash_platform_data da850evm_spiflash_data = {
-	.name		= "m25p80",
 	.parts		= da850evm_spiflash_part,
 	.nr_parts	= ARRAY_SIZE(da850evm_spiflash_part),
 	.type		= "m25p64",
arch/arm/mach-davinci/board-mityomapl138.c +0 -1
index 96fc00a..3c93b65 100644
@@ -350,7 +350,6 @@ static struct mtd_partition spi_flash_partitions[] = {
 };
 
 static struct flash_platform_data mityomapl138_spi_flash_data = {
-	.name		= "m25p80",
 	.parts		= spi_flash_partitions,
 	.nr_parts	= ARRAY_SIZE(spi_flash_partitions),
 	.type		= "m24p64",
arch/arm/mach-shmobile/board-bockw.c +0 -1
index 8a83eb3..e25af56 100644
@@ -266,7 +266,6 @@ static struct mtd_partition m25p80_spi_flash_partitions[] = {
 };
 
 static struct flash_platform_data spi_flash_data = {
-	.name		= "m25p80",
 	.type		= "s25fl008k",
 	.parts		= m25p80_spi_flash_partitions,
 	.nr_parts	= ARRAY_SIZE(m25p80_spi_flash_partitions),
arch/arm/mach-shmobile/board-koelsch.c +0 -1
index b7d5bc7..a494a00 100644
@@ -207,7 +207,6 @@ static struct mtd_partition spi_flash_part[] = {
 };
 
 static const struct flash_platform_data spi_flash_data = {
-	.name		= "m25p80",
 	.parts		= spi_flash_part,
 	.nr_parts	= ARRAY_SIZE(spi_flash_part),
 	.type		= "s25fl512s",
arch/arm/mach-shmobile/board-lager.c +0 -1
index e1d8215..3575731 100644
@@ -315,7 +315,6 @@ static struct mtd_partition spi_flash_part[] = {
 };
 
 static const struct flash_platform_data spi_flash_data = {
-	.name           = "m25p80",
 	.parts          = spi_flash_part,
 	.nr_parts       = ARRAY_SIZE(spi_flash_part),
 	.type           = "s25fl512s",
arch/arm/mach-w90x900/dev.c +0 -1
index e65a80a..9745a73 100644
@@ -249,7 +249,6 @@ static struct mtd_partition nuc900_spi_flash_partitions[] = {
 };
 
 static struct flash_platform_data nuc900_spi_flash_data = {
-	.name = "m25p80",
 	.parts =  nuc900_spi_flash_partitions,
 	.nr_parts = ARRAY_SIZE(nuc900_spi_flash_partitions),
 	.type = "w25x16",
Signature · 6 lines
1.8.4.5

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw

PATCH 1/1 ARM: don't set unused name in struct flash_platform_data

In reply to Rafał Miłecki
Quoted 3 lines · Rafa? Mi?ecki

Loading correct SPI driver (m25p80) is handled using modalias from the struct spi_board_info. There is no point of setting name in the platform_data, m25p80 ignores it anyway.

Wait, is 'name' actually ignored? It looks to me like it sets the MTD name. See the comments in include/linux/spi/flash.h and arch/arm/include/asm/mach/flash.h (BTW, why do we have two definitions for this??):

@name: optional flash device name (eg, as used with mtdparts=)

And I think it's used for exactly that in m25p80.c:

	if (data && data->name)
		flash->mtd.name = data->name;
Quoted 88 lines
---
 arch/arm/mach-davinci/board-da830-evm.c    | 1 -
 arch/arm/mach-davinci/board-da850-evm.c    | 1 -
 arch/arm/mach-davinci/board-mityomapl138.c | 1 -
 arch/arm/mach-shmobile/board-bockw.c       | 1 -
 arch/arm/mach-shmobile/board-koelsch.c     | 1 -
 arch/arm/mach-shmobile/board-lager.c       | 1 -
 arch/arm/mach-w90x900/dev.c                | 1 -
 7 files changed, 7 deletions(-)
arch/arm/mach-davinci/board-da830-evm.c +0 -1
index 5623131..263004a 100644
@@ -567,7 +567,6 @@ static struct mtd_partition da830evm_spiflash_part[] = {
 };
 
 static struct flash_platform_data da830evm_spiflash_data = {
-	.name		= "m25p80",
 	.parts		= da830evm_spiflash_part,
 	.nr_parts	= ARRAY_SIZE(da830evm_spiflash_part),
 	.type		= "w25x32",
arch/arm/mach-davinci/board-da850-evm.c +0 -1
index 234c5bb..721ff2b 100644
@@ -104,7 +104,6 @@ static struct mtd_partition da850evm_spiflash_part[] = {
 };
 
 static struct flash_platform_data da850evm_spiflash_data = {
-	.name		= "m25p80",
 	.parts		= da850evm_spiflash_part,
 	.nr_parts	= ARRAY_SIZE(da850evm_spiflash_part),
 	.type		= "m25p64",
arch/arm/mach-davinci/board-mityomapl138.c +0 -1
index 96fc00a..3c93b65 100644
@@ -350,7 +350,6 @@ static struct mtd_partition spi_flash_partitions[] = {
 };
 
 static struct flash_platform_data mityomapl138_spi_flash_data = {
-	.name		= "m25p80",
 	.parts		= spi_flash_partitions,
 	.nr_parts	= ARRAY_SIZE(spi_flash_partitions),
 	.type		= "m24p64",
arch/arm/mach-shmobile/board-bockw.c +0 -1
index 8a83eb3..e25af56 100644
@@ -266,7 +266,6 @@ static struct mtd_partition m25p80_spi_flash_partitions[] = {
 };
 
 static struct flash_platform_data spi_flash_data = {
-	.name		= "m25p80",
 	.type		= "s25fl008k",
 	.parts		= m25p80_spi_flash_partitions,
 	.nr_parts	= ARRAY_SIZE(m25p80_spi_flash_partitions),
arch/arm/mach-shmobile/board-koelsch.c +0 -1
index b7d5bc7..a494a00 100644
@@ -207,7 +207,6 @@ static struct mtd_partition spi_flash_part[] = {
 };
 
 static const struct flash_platform_data spi_flash_data = {
-	.name		= "m25p80",
 	.parts		= spi_flash_part,
 	.nr_parts	= ARRAY_SIZE(spi_flash_part),
 	.type		= "s25fl512s",
arch/arm/mach-shmobile/board-lager.c +0 -1
index e1d8215..3575731 100644
@@ -315,7 +315,6 @@ static struct mtd_partition spi_flash_part[] = {
 };
 
 static const struct flash_platform_data spi_flash_data = {
-	.name           = "m25p80",
 	.parts          = spi_flash_part,
 	.nr_parts       = ARRAY_SIZE(spi_flash_part),
 	.type           = "s25fl512s",
arch/arm/mach-w90x900/dev.c +0 -0
index e65a80a..9745a73 100644

arch/arm/mach-w90x900/dev.c static struct mtd_partition nuc900_spi_flash_partitions[] = { · line 254

Quoted 7 lines
arch/arm/mach-w90x900/dev.c +0 -1
@@ -249,7 +249,6 @@ static struct mtd_partition nuc900_spi_flash_partitions[] = {
 };
 
 static struct flash_platform_data nuc900_spi_flash_data = {
-	.name = "m25p80",
 	.parts =  nuc900_spi_flash_partitions,
 	.nr_parts = ARRAY_SIZE(nuc900_spi_flash_partitions),
 	.type = "w25x16",

Brian

#3 lore raw

PATCH 1/1 ARM: don't set unused name in struct flash_platform_data

Quoted 10 lines · Brian Norris
Quoted 3 lines · Rafa? Mi?ecki

Loading correct SPI driver (m25p80) is handled using modalias from the struct spi_board_info. There is no point of setting name in the platform_data, m25p80 ignores it anyway.

Wait, is 'name' actually ignored? It looks to me like it sets the MTD name. See the comments in include/linux/spi/flash.h and arch/arm/include/asm/mach/flash.h (BTW, why do we have two definitions for this??):

Quoted 6 lines

@name: optional flash device name (eg, as used with mtdparts=)

And I think it's used for exactly that in m25p80.c:

        if (data && data->name)
                flash->mtd.name = data->name;

And very few lines later in the m25p80.c you have this:
if (data && data->type)

        id = spi_nor_match_id(data->type);

Code I touched in my patch was using both: name and type. So what you got it "type" took a precedence and "name" value was ignored. It seems like ppl used to use "name" to trigger "m25p80" probe, which isn't needed (it's done by SPI layer).

Also see my comment about data->type usage I added in:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=32f1b7c8352fd33d41bcec3cfb054ccdcfd40a42

#4 lore raw

PATCH 1/1 ARM: don't set unused name in struct flash_platform_data

Quoted 13 lines · Rafa? Mi?ecki
Quoted 12 lines · Brian Norris
Quoted 3 lines · Rafa? Mi?ecki

Loading correct SPI driver (m25p80) is handled using modalias from the struct spi_board_info. There is no point of setting name in the platform_data, m25p80 ignores it anyway.

Wait, is 'name' actually ignored? It looks to me like it sets the MTD name. See the comments in include/linux/spi/flash.h and arch/arm/include/asm/mach/flash.h (BTW, why do we have two definitions for this??):

@name: optional flash device name (eg, as used with mtdparts=)

Quoted 8 lines
Quoted 4 lines

And I think it's used for exactly that in m25p80.c:

        if (data && data->name)
                flash->mtd.name = data->name;

And very few lines later in the m25p80.c you have this:
if (data && data->type)

        id = spi_nor_match_id(data->type);

How is that relevant to the value of 'flash->mtd.name'?

Quoted 7 lines

Code I touched in my patch was using both: name and type. So what you got it "type" took a precedence and "name" value was ignored. It seems like ppl used to use "name" to trigger "m25p80" probe, which isn't needed (it's done by SPI layer).

Also see my comment about data->type usage I added in:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=32f1b7c8352fd33d41bcec3cfb054ccdcfd40a42

But I'm not talking about probing / driver matching. The 'name' field is used for assigning the MTD name deterministically. This name is used for things like 'mtdparts'.

Brian

#5 lore raw

PATCH 1/1 ARM: don't set unused name in struct flash_platform_data

In reply to Rafał Miłecki
Quoted 22 lines · Rafa? Mi?ecki
Quoted 10 lines · Brian Norris
Quoted 3 lines · Rafa? Mi?ecki

Loading correct SPI driver (m25p80) is handled using modalias from the struct spi_board_info. There is no point of setting name in the platform_data, m25p80 ignores it anyway.

Wait, is 'name' actually ignored? It looks to me like it sets the MTD name. See the comments in include/linux/spi/flash.h and arch/arm/include/asm/mach/flash.h (BTW, why do we have two definitions for this??):

Quoted 6 lines

@name: optional flash device name (eg, as used with mtdparts=)

And I think it's used for exactly that in m25p80.c:

        if (data && data->name)
                flash->mtd.name = data->name;

And very few lines later in the m25p80.c you have this:
if (data && data->type)

        id = spi_nor_match_id(data->type);
Quoted 7 lines

Code I touched in my patch was using both: name and type. So what you got it "type" took a precedence and "name" value was ignored. It seems like ppl used to use "name" to trigger "m25p80" probe, which isn't needed (it's done by SPI layer).

Also see my comment about data->type usage I added in:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=32f1b7c8352fd33d41bcec3cfb054ccdcfd40a42

Oh, wait. I just noticed you pointed to the code setting mtd's name, not finding a chip name. Sorry, I got a bit confused by so many recent changes to the m25p80 and spi-nor.
So you are right, m25p80 uses this "name" to set the mtd_info's name. Will look at this again.

Signature · 1 line
Rafa?