From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: linuxppc-dev@lists.linuxppc.org
Cc: Anton Blanchard <anton@samba.org>, Paul Mackerras <paulus@samba.org>
Subject: Proposal for device-tree walking semantics
Date: 23 Jun 2003 15:05:13 +0200 [thread overview]
Message-ID: <1056373513.9700.25.camel@gaston> (raw)
Hi !
We all know those need to change, the way they currently work
by returning a linked list of devices is terminally broken
regarding any form of concurrent access...
Here is an example of semantics that I'm implementing in my
tree (no patch below yet, just the definitions), with the additional
notes below:
- Though I haven't implemented refcounting, I added a get/put()
set of functions and define that all of those "find" functions
will return a got'en object that need to be put. That will allow
us to add proper refcounting implementation later, or wrap a
kobject in there. The get() function is actually more a try_get()
(the idea is that a remove in progress would make it fail)
- What about renaming struct device_node to struct of_node ? We
could keep a #define for now (2.5) and get rid of device_node
later ? I find the current naming confusing.
Here we go:
extern struct device_node *of_find_device_by_name(struct device_node
*from,
const char *name);
extern struct device_node *of_find_device_by_type(struct device_node
*from,
const char *type);
extern struct device_node *of_find_compatible_device(struct device_node
*from,
const char *type, const char *compat);
extern struct device_node *of_find_device_by_path(const char *path);
extern struct device_node *of_find_all_devices(struct device_node
*prev);
extern int of_device_get(struct device_node *node);
extern int of_device_put(struct device_node *node);
Comments ?
Ben.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
next reply other threads:[~2003-06-23 13:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-23 13:05 Benjamin Herrenschmidt [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-06-24 16:53 Proposal for device-tree walking semantics Nathan Lynch
2003-06-24 23:25 ` Benjamin Herrenschmidt
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=1056373513.9700.25.camel@gaston \
--to=benh@kernel.crashing.org \
--cc=anton@samba.org \
--cc=linuxppc-dev@lists.linuxppc.org \
--cc=paulus@samba.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 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).