public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* mfd_add_devices() doesn't check whether nodes are "diabled" in dts
@ 2014-09-29  6:40 Barry Song
  2014-09-29  7:53 ` Lee Jones
  0 siblings, 1 reply; 3+ messages in thread
From: Barry Song @ 2014-09-29  6:40 UTC (permalink / raw)
  To: linux-arm-kernel

hi Samuel, Lee,
the current mfd_add_devices() doesn't check whether nodes are diabled
in dts, so even though we put status = "disabled" in dts for a MFD
subnode, it will still create the platform_device. this will cause the
platform_driver to execute probe() entry.

mfd-core is doing:

mfd_add_device()

alloc platform_device no matter it is disabled or not:

92         pdev = platform_device_alloc(cell->name, id + cell->id);
 93         if (!pdev)
 94                 goto fail_alloc;

....
extend all nodes:

112         if (parent->of_node && cell->of_compatible) {
113                 for_each_child_of_node(parent->of_node, np) {
114                         if (of_device_is_compatible(np,
cell->of_compatible)) {
115                                 pdev->dev.of_node = np;
116                                 break;
117                         }
118                 }
119         }

it seems it doesn't match with the general behavior like
of_platform_populate(), in which we only extend available nodes.

how do you think if we do a fix for the behaviour of mfd_add_devices()
and mfd_remove_devices()?

-barry

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-09-29  8:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-29  6:40 mfd_add_devices() doesn't check whether nodes are "diabled" in dts Barry Song
2014-09-29  7:53 ` Lee Jones
2014-09-29  8:00   ` Barry Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox