public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@bootlin.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v7 11/12] cmd: ubi: clean the partition handling
Date: Thu, 6 Sep 2018 11:52:32 +0200	[thread overview]
Message-ID: <20180906115232.18640684@bbrezillon> (raw)
In-Reply-To: <20180906070854.9717-12-miquel.raynal@bootlin.com>

Hi Miquel,

On Thu,  6 Sep 2018 09:08:53 +0200
Miquel Raynal <miquel.raynal@bootlin.com> 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)) {
> +
> +#ifdef CONFIG_MTD
> +	mtd_probe_devices();
> +#endif

Okay, so just like for the mtdparts patch, the #ifdef is incorrect, but
more importantly, with you're rework, you're breaking all non-DM
platforms, because the UBI layer no longer creates an MTD device on the
fly, and the mtd partition creation won't take place if CONFIG_MTD is
not activated.

My suggestion would be to make mtd_probe_devices() available to everyone
(not only those who have CONFIG_MTD selected, which in turn depends on
CONFIG_DM) so that the mtd part creation is done unconditionally, and
you can safely get rid of the "dummy MTD device creation" done in UBI.

> +	mtd = get_mtd_device_nm(part_name);
> +	if (IS_ERR(mtd)) {

Regards,

Boris

  reply	other threads:[~2018-09-06  9:52 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-06  7:08 [U-Boot] [PATCH v7 00/12] SPI-NAND support Miquel Raynal
2018-09-06  7:08 ` [U-Boot] [PATCH v7 01/12] lib: strto: parse all lowercase metric prefixes in ustrtoul[l] Miquel Raynal
2018-09-06  7:08 ` [U-Boot] [PATCH v7 02/12] lib: strto: fix metric suffix parsing in strtoul[l] Miquel Raynal
2018-09-06  7:08 ` [U-Boot] [PATCH v7 03/12] cmd: mtdparts: accept spi-nand devices Miquel Raynal
2018-09-06  7:08 ` [U-Boot] [PATCH v7 04/12] cmd: mtdparts: remove mandatory 'mtdparts=' prefix Miquel Raynal
2018-09-06  7:08 ` [U-Boot] [PATCH v7 05/12] mtd: uclass: add probe function Miquel Raynal
2018-09-06  7:08 ` [U-Boot] [PATCH v7 06/12] mtd: uclass: add a generic 'mtdparts' parser Miquel Raynal
2018-09-06  7:08 ` [U-Boot] [PATCH v7 07/12] mtd: uclass: search for an equivalent MTD name with the mtdids Miquel Raynal
2018-09-06  7:08 ` [U-Boot] [PATCH v7 08/12] mtd: mtdpart: implement proper partition handling Miquel Raynal
2018-09-06  7:08 ` [U-Boot] [PATCH v7 09/12] cmd: mtd: add 'mtd' command Miquel Raynal
2018-09-06  9:42   ` Boris Brezillon
2018-09-06  7:08 ` [U-Boot] [PATCH v7 10/12] cmd: mtdparts: try to probe the MTD devices as a fallback Miquel Raynal
2018-09-06  9:46   ` Boris Brezillon
2018-09-06  7:08 ` [U-Boot] [PATCH v7 11/12] cmd: ubi: clean the partition handling Miquel Raynal
2018-09-06  9:52   ` Boris Brezillon [this message]
2018-09-06  7:08 ` [U-Boot] [PATCH v7 12/12] cmd: mtdparts: describe as legacy Miquel Raynal
2018-09-06  9:57   ` Boris Brezillon
2018-09-06  7:15 ` [U-Boot] [PATCH v7 00/12] SPI-NAND support Miquel Raynal
2018-09-20 14:06   ` Frieder Schrempf
2018-09-20 14:46     ` Jagan Teki
2018-09-20 14:59       ` Miquel Raynal
2018-09-20 15:22         ` Frieder Schrempf
2018-09-21  8:15         ` Jagan Teki
2018-09-21  8:25           ` Miquel Raynal
2018-09-26 15:14           ` Miquel Raynal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180906115232.18640684@bbrezillon \
    --to=boris.brezillon@bootlin.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox