From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Brezillon Date: Thu, 16 Aug 2018 22:38:59 +0200 Subject: [U-Boot] [PATCH v6 29/31] cmd: mtd: add 'mtd' command In-Reply-To: <20180816153029.15521-30-miquel.raynal@bootlin.com> References: <20180816153029.15521-1-miquel.raynal@bootlin.com> <20180816153029.15521-30-miquel.raynal@bootlin.com> Message-ID: <20180816223859.552a5bfd@bbrezillon> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, 16 Aug 2018 17:30:27 +0200 Miquel Raynal wrote: > +/* > + * Ensure the MTD device partition list has been initialized already (needed for > + * non DM-compliant devices). I don't see what this has to do with DM vs non-DM drivers. All MTD devices are registered to the MTD framework, right? So there's probably a place where this list initialization can be done for everyone. > + */ > +static void mtd_quirk_init_non_dm_device_lists(void) > +{ > + struct mtd_info *mtd; > + > + mtd_for_each_device(mtd) { > + if (!mtd_is_partition(mtd) && !mtd->partitions.next) { > + INIT_LIST_HEAD(&mtd->partitions); > + INIT_LIST_HEAD(&mtd->node); Hm, how about moving this initialization in add_mtd_device()? > + } > + } > +} > +