From: greg@kroah.com (Greg KH)
To: kernelnewbies@lists.kernelnewbies.org
Subject: issues dealing with kobjects
Date: Fri, 20 Jun 2014 09:16:47 -0700 [thread overview]
Message-ID: <20140620161647.GB8116@kroah.com> (raw)
In-Reply-To: <53A3CE1F.1070906@cdac.in>
On Fri, Jun 20, 2014 at 11:31:03AM +0530, Raghavendra wrote:
> Hello all,
>
> I am facing a small issue dealing with kobjects.
> I am writing a simple i2c driver for which I would like to export a few
> sysfs attributes(files).
Please don't, unless these attributes are something that all other i2c
drivers export and are documented in Documentation/ABI/
> The files are many, so I've decided to pack them into a directory in
> sysfs (inside the i2c device) and so I thought of kobjects.
No, please never use "raw" kobjects in a driver, use the driver core
functions instead. You can have an attribute group that is associated
with your driver or device, and the driver core will automatically
create the files for you (in a subdir if you want it), in a race-free
manner. Please use that interface instead.
thanks,
greg k-h
prev parent reply other threads:[~2014-06-20 16:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-20 6:01 issues dealing with kobjects Raghavendra
2014-06-20 6:22 ` enjoy mindful
2014-06-20 8:24 ` Raghavendra
2014-06-20 16:16 ` 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=20140620161647.GB8116@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).