From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: "Brian Norris" <computersforpeace@gmail.com>,
"Richard Weinberger" <richard@nod.at>,
"David Woodhouse" <dwmw2@infradead.org>,
"Marek Vasut" <marek.vasut@gmail.com>,
"Rafał Miłecki" <zajec5@gmail.com>,
linux-mtd@lists.infradead.org, stable@vger.kernel.org
Subject: Re: [PATCH] mtd: partitions: fix of_node_get/put balance in parser
Date: Mon, 10 Sep 2018 15:32:03 +0200 [thread overview]
Message-ID: <20180910153203.008398c1@bbrezillon> (raw)
In-Reply-To: <20180910152551.23ffa474@bbrezillon>
On Mon, 10 Sep 2018 15:25:51 +0200
Boris Brezillon <boris.brezillon@bootlin.com> wrote:
>
> > I think if the helper was
> > named "mtd_to_of_node()" that would be much clearer for everyone and
> > of_node_get(mtd_to_of_node(mtd)) would be the way to retain a reference
> > on the OF node.
> >
> > I don't think creating a helper for that would be better because I
> > really prefer seeing the of_node_get() in the code, meaning an
> > of_node_put() will be needed at some point.
>
> Again, it's mainly a matter of consistency. If people are used to call
> of_node_put() when a function returns a device_node object, then it's
> better to do the same in the MTD framework.
Just to be clear. I still want to queue this patch for 4.19-rc4. All
I'm saying is that we should consider changing the behavior of
mtd_get_of_node() (and friends) at some point, otherwise we might see
other bugs like this one in the future.
On a side note, we should probably also call of_node_get/put() when
someone updates mtd->dev.of_node through the mtd_set_of_node() helper,
and call of_node_put() when an mtd device is unregistered.
next prev parent reply other threads:[~2018-09-10 13:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-07 14:35 [PATCH] mtd: partitions: fix of_node_get/put balance in parser Miquel Raynal
2018-09-07 14:38 ` Miquel Raynal
2018-09-10 12:53 ` Boris Brezillon
2018-09-10 13:14 ` Miquel Raynal
2018-09-10 13:25 ` Boris Brezillon
2018-09-10 13:32 ` Boris Brezillon [this message]
2018-09-10 13:38 ` Miquel Raynal
2018-09-10 13:42 ` Boris Brezillon
2018-09-17 9:55 ` Miquel Raynal
2018-09-17 13:51 ` Boris Brezillon
2018-09-17 14:03 ` Miquel Raynal
2018-09-17 14:24 ` Boris Brezillon
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=20180910153203.008398c1@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=stable@vger.kernel.org \
--cc=zajec5@gmail.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