From: gprabhunath@gmail.com (Prabhu nath)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Adding a kobject in the device model hierarchy
Date: Sat, 1 Jan 2011 21:58:11 +0530 [thread overview]
Message-ID: <AANLkTinC-Od5fLz9Jk-UzLSdUv7KpbjYfSbqQq7qDsei@mail.gmail.com> (raw)
Dear All,
I have written one pseudo char driver. I have initialized the device
generic structure
with cdev_init function. This will initialize the kobject structure
embedded within struct cdev
with appropriate ktype. If I want to add this kobject in
/sys/devices/virtual/misc/ location
of sysfs, how is the following fields set
* kobj->parent
* kobj->kset
* kobj->kset->obj.
Also, in general how to look out for the parent kobject ? Would like to
know, if there are
mechanisms provisioned by Linux Kernel.
Robert: My 2 cents as I am reading the LKD(3rd edition), it would be
appropriate to add one
example as a solution to the above problem. Generally, it has
been told as
kobj->kset = my_kset in Page # 353.
Note: Even in LDD(3rd editon page 369). It has been mentioned that "The
kobject's kset field must be
pointed at the kset of interest"
Thanks,
Prabhu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110101/0dc4abe1/attachment.html
next reply other threads:[~2011-01-01 16:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-01 16:28 Prabhu nath [this message]
2011-01-02 2:50 ` Adding a kobject in the device model hierarchy Greg KH
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=AANLkTinC-Od5fLz9Jk-UzLSdUv7KpbjYfSbqQq7qDsei@mail.gmail.com \
--to=gprabhunath@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.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).