Re: [PATCH v3 3/8] nand: spi: add basic blocks for infrastructure

Peter Pan
2017-03-17T10:23:06Z

Hi Arnaud,

On Fri, Mar 17, 2017 at 6:20 PM, Arnaud Mouiche
<arnaud.mouiche@gmail.com> wrote:
> [...]
>>
>> +/*
>> + * spinand_detect - [SPI NAND Interface] detect the SPI NAND device
>> + * @chip: SPI NAND device structure
>> + */
>> +int spinand_detect(struct spinand_device *chip)
>> +{
>> + struct nand_device *nand = &chip->base;
>> + u8 raw_id[SPINAND_MAX_ID_LEN] = {0};
>> + u8 id[SPINAND_MAX_ID_LEN] = {0};
>> + int ret;
>> +
>> + spinand_reset(chip);
>> + spinand_read_id(chip, raw_id);
>> + ret = spinand_manufacturer_detect(chip, raw_id, id);
>> + if (ret)
>
>
> Would be great to return an error or warning message when the raw_id doesn't
> match any known manufacturer, or when the manufacturer doesn't know about
> this device.
> something like:
>
> pr_err("SPI NAND: unknown raw ID %*phN\n", SPINAND_MAX_ID_LEN, raw_id);
>

Yes, you are right. I missed this part! I will add it in v4

Thanks
Peter Pan