ARM: don't set unused name in struct flash_platform_data
Subsystems (6)
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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 theplatform_data, m25p80 ignores it anyway.Signed-off-by Rafa? Mi?ecki <[email protected]>
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@@ -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@@ -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@@ -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@@ -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@@ -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@@ -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@@ -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
PATCH 1/1 ARM: don't set unused name in struct flash_platform_data
In reply to Rafał MiłeckiQuoted 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 theplatform_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
Signed-off-by Rafa? Mi?ecki <[email protected]>--- 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@@ -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@@ -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@@ -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@@ -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@@ -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@@ -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
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
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 theplatform_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.handarch/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
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 theplatform_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.handarch/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.cyou 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->typeusage 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
PATCH 1/1 ARM: don't set unused name in struct flash_platform_data
In reply to Rafał MiłeckiQuoted 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 theplatform_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.handarch/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.cyou 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->typeusage 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?