[PATCH v2 5/6] mtd: spi-nor: simplify spi_nor_get_flash_info()

Tudor Ambarus tudor.ambarus at linaro.org
Mon Apr 22 03:14:41 PDT 2024



On 4/22/24 11:12, Tudor Ambarus wrote:
> 
> 
> On 4/22/24 10:53, Michael Walle wrote:
>> Hi,
>>
>>> 	if (name)
>>> 		info = spi_nor_match_name(nor, name);
>>>
>>> 	if (!info || info->id) {
> 
> here
> 
>>> 		jinfo = spi_nor_detect(nor);
>>> 		if (IS_ERR(jinfo))
>>> 			return jinfo;
>>> 		
>>> 		if (jinfo != info)
>>
>> info could be NULL here. So "info &&", apart from that looks good.
> 
> it can't be NULL, the parent if indicated above assures info isn't NULL

ah, I read it wrong it's if (!info), you're right!

> 
>>
>>> 			dev_warn(();
>>> 		info = jinfo;
>>> 	}
>>
>> Pratyush, should I'll drop your Rb tag then.
>>
>> -michael



More information about the linux-mtd mailing list