All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] dm: core: make fixed-clock dt scan live dt compatible
Date: Sun, 1 Apr 2018 22:28:53 +0800	[thread overview]
Message-ID: <CAPnjgZ1bOgzPWkJeK-9CgEKCP2C53+H-oG-9P9EXV0DrXJY_Kw@mail.gmail.com> (raw)
In-Reply-To: <4b4fa726-7ebe-6640-56ac-b50aeb2af04d@rock-chips.com>

On 20 March 2018 at 08:56, Andy Yan <andy.yan@rock-chips.com> wrote:
> Hi Simon:
>
>
>
> On 2018年03月20日 01:58, Simon Glass wrote:
>>
>> Hi Andy,
>>
>> On 10 March 2018 at 23:58, Andy Yan <andy.yan@rock-chips.com> wrote:
>>>
>>> Hi Simon:
>>>
>>>
>>>
>>> On 2018年03月09日 05:03, Simon Glass wrote:
>>>>
>>>> Hi Andy.
>>>>
>>>> On 28 February 2018 at 23:08, Andy Yan <andy.yan@rock-chips.com> wrote:
>>>>>
>>>>> dm_scan_fdt_node can't work when live dt is active,
>>>>> we should use dm_scan_fdt_live instead.
>>>>>
>>>>> Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
>>>>> ---
>>>>>
>>>>>    drivers/core/root.c | 16 +++++++++++-----
>>>>>    1 file changed, 11 insertions(+), 5 deletions(-)
>>>>>
>>>> Reviewed-by: Simon Glass <sjg@chromium.org>
>>>>
>>>> with change below
>>>>
>>>>> diff --git a/drivers/core/root.c b/drivers/core/root.c
>>>>> index 36336b6..b437892 100644
>>>>> --- a/drivers/core/root.c
>>>>> +++ b/drivers/core/root.c
>>>>> @@ -333,7 +333,8 @@ static int dm_scan_fdt_node(struct udevice *parent,
>>>>> const void *blob,
>>>>>
>>>>>    int dm_extended_scan_fdt(const void *blob, bool pre_reloc_only)
>>>>>    {
>>>>> -       int node, ret;
>>>>> +       int ret;
>>>>> +       ofnode node;
>>>>>
>>>>>           ret = dm_scan_fdt(gd->fdt_blob, pre_reloc_only);
>>>>>           if (ret) {
>>>>> @@ -342,13 +343,18 @@ int dm_extended_scan_fdt(const void *blob, bool
>>>>> pre_reloc_only)
>>>>>           }
>>>>>
>>>>>           /* bind fixed-clock */
>>>>> -       node = ofnode_to_offset(ofnode_path("/clocks"));
>>>>> +       node = ofnode_path("/clocks");
>>>>>           /* if no DT "clocks" node, no need to go further */
>>>>> -       if (node < 0)
>>>>> +       if (!ofnode_valid(node))
>>>>>                   return ret;
>>>>>
>>>>> -       ret = dm_scan_fdt_node(gd->dm_root, gd->fdt_blob, node,
>>>>> -                              pre_reloc_only);
>>>>> +#if CONFIG_IS_ENABLED(OF_LIVE)
>>>>
>>>> You should be able to drop this #if since of_live_active() takes care of
>>>> it.
>>>
>>>
>>>      But I found function dm_scan_fdt_live is depends on #if
>>> CONFIG_IS_ENABLE(OF_LIVE)
>>
>> Yes, I wonder if that can be removed, if the above becomes an if() ?
>
>
> dm_scan_fdt_live only called in root.c, and the caller use
> if(of_live_active) as a check, so I think we can remove the #if
>
>>
>> If not, then what you have now is OK.
>>

Applied to u-boot-dm, thanks!

      reply	other threads:[~2018-04-01 14:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-01  6:08 [U-Boot] [PATCH] dm: core: make fixed-clock dt scan live dt compatible Andy Yan
2018-03-08 21:03 ` Simon Glass
2018-03-11  6:58   ` Andy Yan
2018-03-19 17:58     ` Simon Glass
2018-03-20  0:56       ` Andy Yan
2018-04-01 14:28         ` Simon Glass [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=CAPnjgZ1bOgzPWkJeK-9CgEKCP2C53+H-oG-9P9EXV0DrXJY_Kw@mail.gmail.com \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /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.