All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mario Six <mario.six@gdsys.cc>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/8] core: Add uclass_{first, next}_device_compat
Date: Wed, 11 Apr 2018 09:15:30 +0200	[thread overview]
Message-ID: <CAN1kZoo_oaAuVMo5MXAOwnwO6X0kXtERTRGDchv6WvJ-p-Sa7w@mail.gmail.com> (raw)
In-Reply-To: <CAPnjgZ3XO4LARZ_WpYv0mNGRCR1YOJHj4RR4JaKysqo0oDj9fQ@mail.gmail.com>

Hi Simon,

On Fri, Mar 30, 2018 at 10:41 AM, Simon Glass <sjg@chromium.org> wrote:
> Hi Mario,
>
> On 28 March 2018 at 20:38, Mario Six <mario.six@gdsys.cc> wrote:
>> A lot of times one wants to cycle through the devices in a uclass, but
>> only certain ones, especially ones identified by their compatibility
>> string, and ignore all others (in the best case this procedure should
>> not even activate the devices one is not interested in).
>>
>> Hence, we add a pair of functions similar to uclass_{first,next}_device,
>> but taking a compatibility string as an additional argument, which cycle
>> through the devices of a uclass that conform to this compatibility
>> string.
>
> Can we not use a phandle to find the device? Using raw compatible
> strings feel bad (and slow to me).
>
> If not, a please add a sandbox test.
>

A phandle would indeed be the cleaner solution, but it won't work if you have
to get device handles in board files, since there is no device for a board you
could query for a phandle. And the MPC83xx board this series leads up to needs
to gather numerous device handles for configuration and querying purposes.

If there was a underlying device for the board functions there would be no
issue with using a phandle, but as it is, it sadly won't work.

>>
>> Signed-off-by: Mario Six <mario.six@gdsys.cc>
>> ---
>>  drivers/core/uclass.c | 33 +++++++++++++++++++++++++++++++++
>>  include/dm/uclass.h   | 37 +++++++++++++++++++++++++++++++++++++
>>  2 files changed, 70 insertions(+)
>
> Regards,
> Simon
>

Best regards,

Mario

  reply	other threads:[~2018-04-11  7:15 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-28 12:38 [U-Boot] [PATCH 1/8] core: Add uclass_{first,next}_device_compat Mario Six
2018-03-28 12:38 ` [U-Boot] [PATCH 2/8] test: Add tests for uclass_{first, next}_device_compat Mario Six
2018-03-28 12:38 ` [U-Boot] [PATCH 3/8] ram: Add driver for MPC83xx Mario Six
2018-03-28 12:38 ` [U-Boot] [PATCH 4/8] clk: Add MPC83xx clock driver Mario Six
2018-03-28 12:38 ` [U-Boot] [PATCH 5/8] timer: Add MPC83xx timer driver Mario Six
2018-03-28 12:38 ` [U-Boot] [PATCH 6/8] cpu: Add cpu_print_info function Mario Six
2018-03-30  8:41   ` Simon Glass
2018-04-11  6:39     ` Mario Six
2018-04-12 16:37       ` Simon Glass
2018-04-18  8:35         ` Mario Six
2018-04-18 15:45           ` Simon Glass
2018-04-19  7:50             ` Mario Six
2018-04-24 21:53               ` Simon Glass
2018-04-26  6:07                 ` Mario Six
2018-04-26 14:40                   ` Simon Glass
2018-04-27 12:16                     ` Mario Six
2018-03-28 12:38 ` [U-Boot] [PATCH 7/8] cpu: Add MPC83xx CPU driver Mario Six
2018-03-28 12:38 ` [U-Boot] [PATCH 8/8] misc: Add MPC83xx serdes driver Mario Six
2018-03-30  8:41 ` [U-Boot] [PATCH 1/8] core: Add uclass_{first, next}_device_compat Simon Glass
2018-04-11  7:15   ` Mario Six [this message]
2018-04-12 16:31     ` Simon Glass
2018-04-18  9:02       ` Mario Six

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=CAN1kZoo_oaAuVMo5MXAOwnwO6X0kXtERTRGDchv6WvJ-p-Sa7w@mail.gmail.com \
    --to=mario.six@gdsys.cc \
    --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.