All of lore.kernel.org
 help / color / mirror / Atom feed
From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: mfd_add_devices() doesn't check whether nodes are "diabled" in dts
Date: Mon, 29 Sep 2014 08:53:32 +0100	[thread overview]
Message-ID: <20140929075332.GC7308@lee--X1> (raw)
In-Reply-To: <CAGsJ_4yqumj3=54HwxuzVffPjHdQZrCP2wYc2TSumKsg0-wm7w@mail.gmail.com>

On Mon, 29 Sep 2014, Barry Song wrote:

> 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()?

Yes, sounds good.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2014-09-29  7:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2014-09-29  8:00   ` Barry Song

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=20140929075332.GC7308@lee--X1 \
    --to=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.