Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1273707

Re: [PATCH v2 13/11] mtd: assign mtd->dev.of_node when creating partition devices

From Brian Norris <computersforpeace@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 13/11] mtd: assign mtd->dev.of_node when creating partition devices
Date 2015-11-20 04:00 +0100
Message-ID <qwK5z-1aE-11@gated-at.bofh.it> (permalink)
References <qpvbj-69C-5@gated-at.bofh.it> <qqbke-6S5-13@gated-at.bofh.it> <qtNMl-1zI-3@gated-at.bofh.it> <qu06S-ZA-29@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Nov 12, 2015 at 02:22:20PM +0100, Boris Brezillon wrote:
> On Wed, 11 Nov 2015 16:15:50 -0800
> Brian Norris <computersforpeace@gmail.com> wrote:
> > IOW, I think we can grab the reference in add_mtd_device() and drop it
> > in del_mtd_device(). This would handle both the partition and
> > non-partition case the same.
> 
> Hm, actually I think we need it. When you iterate over child nodes with
> for_each_child_of_node(), the node is released (of_node_put() is
> called) after each iteration. While this is not a problem for mtd
> device registration (because the controller usually retain the
> reference when add_mtd_device() is called), this is not true for the
> partitions. And if the partitions are ever defined using an overlay,
> this can be a problem.

Yep.

> To sum-up, I think we should retain the node reference until
> add_mtd_device() has retained it, so maybe we should have a ->cleanup()
> function in mtd part parsers.

OK. I'll drop my patch and send out my ->cleanup() stuff instead, so you
can patch on top of that.

Brian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH v2 13/11] mtd: assign mtd->dev.of_node when creating  partition devices Brian Norris <computersforpeace@gmail.com> - 2015-11-20 04:00 +0100

csiph-web