LKML Archive on
help / color / mirror / Atom feed
From: Greg KH <>
To: Simon White <>
Subject: Re: Multiple virtual bus instances
Date: Wed, 7 Feb 2007 21:54:52 -0800	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Wed, Feb 07, 2007 at 02:15:08PM -0800, Simon White wrote:
> Hi,
> I've been working through trying to create a virtual
> bus.

How does this differ from a "real" bus?

> I've successfuly made it work for a single instance but wanted to
> confirm how to create multiple instances of the virtual bus.

Why would you need that?

> I believe to do this you have only one instance of your new
> bus_type registered but register multiple instances of struct device
> for it.  I just wanted to confirm that was correct.

That would create multiple devices on the same bus.  Is that what you
need to do?

> Lastly how do you walk over all devices on a bus
> instance?

You usually do this in your bus-specific code somehow.

> I note bus_for_each_dev but that appears to take a bus_type rather
> than struct device instance, hence I assume it will return all devices
> from all instances.

No, it will walk the bus that you created.  If you need multiple busses,
create multiple 'struct bus_type' structures.

> I know I could compare each device to see if it is on a certain bus
> instance but wondered if there was a better way?

I think you will find that it works the way it is described.

Might I ask what you are trying to do with these multiple busses?

Note that you can have multiple trees of devices, all with the same
bus_type, yet not joined together in any other way.  Odds are, you
probably want to do that, right?


greg k-h

  reply	other threads:[~2007-02-08  5:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-07 22:15 Simon White
2007-02-08  5:54 ` Greg KH [this message]
2007-02-08  9:23 Simon White

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \
    --subject='Re: Multiple virtual bus instances' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).