kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: greg@kroah.com (Greg KH)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Adding a kobject in the device model hierarchy
Date: Sat, 1 Jan 2011 18:50:32 -0800	[thread overview]
Message-ID: <20110102025032.GA24748@kroah.com> (raw)
In-Reply-To: <AANLkTinC-Od5fLz9Jk-UzLSdUv7KpbjYfSbqQq7qDsei@mail.gmail.com>

On Sat, Jan 01, 2011 at 09:58:11PM +0530, Prabhu nath wrote:
> 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.

But NEVER touch that kobject, it is not for your use at all.

> 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.

Nope, you need your own struct device, do not use the kobject in the
cdev, again, it is NOT for use at all.  It is private to a cdev and
I need to figure out a way to make it so that you can't even see it one
day to keep people from trying to use it.

good luck,

greg k-h

      reply	other threads:[~2011-01-02  2:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-01 16:28 Adding a kobject in the device model hierarchy Prabhu nath
2011-01-02  2:50 ` Greg KH [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=20110102025032.GA24748@kroah.com \
    --to=greg@kroah.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).