From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Brezillon Date: Thu, 16 Aug 2018 21:17:15 +0200 Subject: [U-Boot] [PATCH v6 31/31] cmd: ubi: clean the partition handling In-Reply-To: <20180816153029.15521-32-miquel.raynal@bootlin.com> References: <20180816153029.15521-1-miquel.raynal@bootlin.com> <20180816153029.15521-32-miquel.raynal@bootlin.com> Message-ID: <20180816211715.3dc1ddcb@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:29 +0200 Miquel Raynal wrote: > > int ubi_part(char *part_name, const char *vid_header_offset) > { > + struct mtd_info *mtd; > int err = 0; > - char mtd_dev[16]; > - struct mtd_device *dev; > - struct part_info *part; > - u8 pnum; > > ubi_detach(); > - /* > - * Search the mtd device number where this partition > - * is located > - */ > - if (find_dev_and_part(part_name, &dev, &pnum, &part)) { > + > + mtd_probe_devices(); This function is only available if CONFIG_CMD_MTD=y, and you didn't add the dependency on CMD_MTD. Anyway, as said earlier, I think this function should be moved out of cmd/mtd.c. > + mtd = get_mtd_device_nm(part_name); > + if (IS_ERR(mtd)) { > printf("Partition %s not found!\n", part_name); > return 1; > }