* [PATCH] mtd: m25p80: Get mtd_info->name from spi_device as the second choice
@ 2015-07-10 8:10 Haikun Wang
2015-07-11 17:14 ` Rafał Miłecki
0 siblings, 1 reply; 3+ messages in thread
From: Haikun Wang @ 2015-07-10 8:10 UTC (permalink / raw
To: linux-mtd, dwmw2, computersforpeace; +Cc: Haikun Wang
If we can't get "mtd_info->name" form struct flash_platform_data,
get it from "spi_device".
Signed-off-by: Haikun Wang <haikun.wang@freescale.com>
---
drivers/mtd/devices/m25p80.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index d313f948b..ebac9e5 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -215,6 +215,8 @@ static int m25p_probe(struct spi_device *spi)
if (data && data->name)
flash->mtd.name = data->name;
+ else
+ flash->mtd.name = dev_name(&spi->dev);
/* For some (historical?) reason many platforms provide two different
* names in flash_platform_data: "name" and "type". Quite often name is
--
2.1.0.27.g96db324
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mtd: m25p80: Get mtd_info->name from spi_device as the second choice
2015-07-10 8:10 [PATCH] mtd: m25p80: Get mtd_info->name from spi_device as the second choice Haikun Wang
@ 2015-07-11 17:14 ` Rafał Miłecki
2015-07-13 11:01 ` Wang Haikun
0 siblings, 1 reply; 3+ messages in thread
From: Rafał Miłecki @ 2015-07-11 17:14 UTC (permalink / raw
To: Haikun Wang; +Cc: linux-mtd@lists.infradead.org, David Woodhouse, Brian Norris
On 10 July 2015 at 10:10, Haikun Wang <haikun.wang@freescale.com> wrote:
> If we can't get "mtd_info->name" form struct flash_platform_data,
> get it from "spi_device".
>
> Signed-off-by: Haikun Wang <haikun.wang@freescale.com>
> ---
> drivers/mtd/devices/m25p80.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
> index d313f948b..ebac9e5 100644
> --- a/drivers/mtd/devices/m25p80.c
> +++ b/drivers/mtd/devices/m25p80.c
> @@ -215,6 +215,8 @@ static int m25p_probe(struct spi_device *spi)
>
> if (data && data->name)
> flash->mtd.name = data->name;
> + else
> + flash->mtd.name = dev_name(&spi->dev);
I'm curious. Is this for changing kernel messages to include some nice
name? Can you give us an example of before vs. after?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mtd: m25p80: Get mtd_info->name from spi_device as the second choice
2015-07-11 17:14 ` Rafał Miłecki
@ 2015-07-13 11:01 ` Wang Haikun
0 siblings, 0 replies; 3+ messages in thread
From: Wang Haikun @ 2015-07-13 11:01 UTC (permalink / raw
To: Rafał Miłecki
Cc: linux-mtd@lists.infradead.org, David Woodhouse, Brian Norris
On 7/12/2015 1:14 AM, Rafał Miłecki wrote:
> On 10 July 2015 at 10:10, Haikun Wang <haikun.wang@freescale.com> wrote:
>> If we can't get "mtd_info->name" form struct flash_platform_data,
>> get it from "spi_device".
>>
>> Signed-off-by: Haikun Wang <haikun.wang@freescale.com>
>> ---
>> drivers/mtd/devices/m25p80.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
>> index d313f948b..ebac9e5 100644
>> --- a/drivers/mtd/devices/m25p80.c
>> +++ b/drivers/mtd/devices/m25p80.c
>> @@ -215,6 +215,8 @@ static int m25p_probe(struct spi_device *spi)
>>
>> if (data && data->name)
>> flash->mtd.name = data->name;
>> + else
>> + flash->mtd.name = dev_name(&spi->dev);
>
> I'm curious. Is this for changing kernel messages to include some nice
> name? Can you give us an example of before vs. after?
>
Function "spi_nor_scan" already has this checking:
if (!mtd->name)
mtd->name = dev_name(dev);
commit id: 32f1b7c8352fd33d41bcec3cfb054ccdcfd40a42
This patch is duplicate.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-07-13 11:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-10 8:10 [PATCH] mtd: m25p80: Get mtd_info->name from spi_device as the second choice Haikun Wang
2015-07-11 17:14 ` Rafał Miłecki
2015-07-13 11:01 ` Wang Haikun
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.