From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Chou Date: Sun, 6 Dec 2015 19:37:33 +0800 Subject: [U-Boot] [PATCH v5 2/3] cfi_flash: convert to driver model In-Reply-To: References: <1444289667-23775-1-git-send-email-thomas@wytron.com.tw> <1446883058-8321-1-git-send-email-thomas@wytron.com.tw> <1446883058-8321-2-git-send-email-thomas@wytron.com.tw> Message-ID: <56641DFD.1080004@wytron.com.tw> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Jagan, On 2015?12?06? 16:23, Jagan Teki wrote: >> +#ifdef CONFIG_CFI_FLASH /* for driver model */ >> +static void cfi_flash_init_dm(void) >> +{ >> + struct udevice *dev; >> + >> + cfi_flash_num_flash_banks = 0; >> + /* >> + * The uclass_first_device() will probe the first device and >> + * uclass_next_device() will probe the rest if they exist. So >> + * that cfi_flash_probe() will get called assigning the base >> + * addresses that are available. >> + */ >> + for (uclass_first_device(UCLASS_MTD, &dev); >> + dev; >> + uclass_next_device(&dev)) { >> + } >> +} > > I think this is for probing MTD_UCLASS drivers is it? for my > understanding MTD should be generic to all the flash variants if so > this probing shouldn't be CFI specific or If MTD uclass is specific to > CFI this implementation is correct. Can you comment which one is true. This probing is not specific to CFI flash. It will probe all flash variants of MTD uclass. Best regards, Thomas