From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Richard Weinberger <richard@nod.at>,
David Woodhouse <dwmw2@infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
Marek Vasut <marek.vasut@gmail.com>,
linux-mtd@lists.infradead.org,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH] mtd: implement proper partition handling
Date: Mon, 17 Dec 2018 12:50:31 +0100 [thread overview]
Message-ID: <20181217125031.4ebe9542@bbrezillon> (raw)
In-Reply-To: <20181211174302.9913-1-miquel.raynal@bootlin.com>
On Tue, 11 Dec 2018 18:43:02 +0100
Miquel Raynal <miquel.raynal@bootlin.com> 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().
prev parent reply other threads:[~2018-12-17 11:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-11 17:43 [PATCH] mtd: implement proper partition handling Miquel Raynal
2018-12-17 10:24 ` Boris Brezillon
2018-12-17 11:50 ` Boris Brezillon [this message]
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=20181217125031.4ebe9542@bbrezillon \
--to=boris.brezillon@bootlin.com \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=thomas.petazzoni@bootlin.com \
/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;
as well as URLs for NNTP newsgroup(s).