[U-Boot] [PATCH v3 2/3] cfi_flash: convert to driver model

Thomas Chou thomas at wytron.com.tw
Tue Nov 3 07:25:53 CET 2015


Hi Stefan,

On 2015年11月03日 13:56, Stefan Roese wrote:
>> if (CONFIG_IS_ENABLED(CFI_FLASH)) {
>>      struct udevice *dev;
>>      cfi_flash_num_flash_banks = 0;
>>      /* probe every MTD device to find cfi-flash device */
>>      for (uclass_first_device(UCLASS_MTD, &dev);
>>           dev;
>>           uclass_next_device(&dev)) {
>>      }
>> }
>
> I'm still not an expert in the DM internals. I fail to see, where
> the actual probing is happening in the loop. Is it buried in the
> uclass_first_device() call?

The probing is happening in both uclass_first_device() and 
uclass_next_device().

The uclass_first_device() will probe the first device.
While uclass_next_device() will probe the rest if they exist.

Best regards,
Thomas


More information about the U-Boot mailing list