From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Roese Date: Tue, 3 Nov 2015 08:22:56 +0100 Subject: [U-Boot] [PATCH v3 2/3] cfi_flash: convert to driver model In-Reply-To: <56385371.3010305@wytron.com.tw> References: <1444289667-23775-1-git-send-email-thomas@wytron.com.tw> <1446212027-20630-1-git-send-email-thomas@wytron.com.tw> <1446212027-20630-2-git-send-email-thomas@wytron.com.tw> <56371CE1.9000203@denx.de> <5637FE76.3050208@wytron.com.tw> <56384C9C.6030709@denx.de> <56385371.3010305@wytron.com.tw> Message-ID: <563860D0.1070206@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Thomas, On 03.11.2015 07:25, Thomas Chou wrote: > 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. Okay. So cfi_flash_probe() will get called assigning the base addresses that are available. The real "probing" (meaning detection) is happening later in flash_init(). I think adding (or extending) a comment here to describe this would be helpful in v2. Thanks, Stefan