[PATCH] mtd: m25p80: Get mtd_info->name from spi_device as the second choice

Wang Haikun Haikun.Wang at freescale.com
Mon Jul 13 04:01:41 PDT 2015


On 7/12/2015 1:14 AM, Rafał Miłecki wrote:
> On 10 July 2015 at 10:10, Haikun Wang <haikun.wang at 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 at 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.




More information about the linux-mtd mailing list