[PATCH 2/4] mtd: UBI: Add support for updating static volumes
Sascha Hauer
s.hauer at pengutronix.de
Wed Jun 22 23:36:27 PDT 2016
Hi Teresa,
On Wed, Jun 22, 2016 at 11:02:39AM +0200, Teresa Remmet wrote:
> Added support to update UBI static volumes in barebox.
> This is mainly realized with adding the ioctl UBI_IOCVOLUP.
>
> Signed-off-by: Teresa Remmet <t.remmet at phytec.de>
> ---
> drivers/mtd/ubi/barebox.c | 56 +++++++++++++++++++++++++++++++++++++++++++++--
> drivers/mtd/ubi/upd.c | 12 ----------
> 2 files changed, 54 insertions(+), 14 deletions(-)
>
>
> int ubi_volume_cdev_add(struct ubi_device *ubi, struct ubi_volume *vol)
> @@ -179,6 +227,10 @@ int ubi_volume_cdev_add(struct ubi_device *ubi, struct ubi_volume *vol)
> cdev->name = basprintf("%s.%s", ubi->cdev.name, vol->name);
> cdev->priv = priv;
> cdev->size = vol->used_bytes;
> +
> + if (vol->vol_type == UBI_STATIC_VOLUME)
> + cdev->flags = DEVFS_IS_CHARACTER_DEV;
> +
> cdev->dev = &vol->dev;
> ubi_msg(ubi, "registering %s as /dev/%s", vol->name, cdev->name);
> ret = devfs_create(cdev);
> diff --git a/drivers/mtd/ubi/upd.c b/drivers/mtd/ubi/upd.c
> index 33d4dbf..e3deb3e 100644
> --- a/drivers/mtd/ubi/upd.c
> +++ b/drivers/mtd/ubi/upd.c
> @@ -368,18 +368,6 @@ int ubi_more_update_data(struct ubi_device *ubi, struct ubi_volume *vol,
> }
>
> ubi_assert(vol->upd_received <= vol->upd_bytes);
> - if (vol->upd_received == vol->upd_bytes) {
> - err = ubi_wl_flush(ubi, UBI_ALL, UBI_ALL);
> - if (err)
> - return err;
> - /* The update is finished, clear the update marker */
> - err = clear_update_marker(ubi, vol, vol->upd_bytes);
> - if (err)
> - return err;
> - vol->updating = 0;
> - err = to_write;
> - vfree(vol->upd_buf);
> - }
Why is this removed? Does it still work to just write to the UBI volume
without this?
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
More information about the barebox
mailing list