On Tue, 11 Dec 2018 18:43:02 +0100 Miquel Raynal <miquel.raynal@xxxxxxxxxxx> wrote: > int del_mtd_partitions(struct mtd_info *mtd) > { > - struct mtd_part *slave, *next; > - int ret, err = 0; > + int ret; > + > + pr_info("Deleting MTD partitions on \"%s\":\n", mtd->name); > > mutex_lock(&mtd_partitions_mutex); Can we find a way to turn this global lock into a per-mtd-object lock? It probably requires reworking the implementation to make lockdep happy, but that should be doable. > - list_for_each_entry_safe(slave, next, &mtd_partitions, list) > - if (slave->parent == mtd) { > - ret = __mtd_del_partition(slave); > - if (ret < 0) > - err = ret; > - } > + ret = __del_mtd_partitions(mtd); > mutex_unlock(&mtd_partitions_mutex); > > - return err; > + return ret; > } > Do you have a good reason for creating __del_mtd_partitions()? Looks like it's only used by del_mtd_partitions(). ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/