From: Andi Kleen <andi@firstfloor.org>
To: johnlinn@comcast.net
Cc: linux-kernel@vger.kernel.org
Subject: Re: using a single sysfs show function for multiple device attributes
Date: Wed, 29 Jun 2011 13:00:35 -0700 [thread overview]
Message-ID: <m239is2ysc.fsf@firstfloor.org> (raw)
In-Reply-To: <409519530.22419.1309373631423.JavaMail.root@sz0140a.emeryville.ca.mail.comcast.net> (johnlinn@comcast.net's message of "Wed, 29 Jun 2011 18:53:51 +0000 (UTC)")
johnlinn@comcast.net writes:
>
> I'm sure it's obvious, but I don't see what I'm doing wrong.
The standard way is to define your own attribute structure that
has the standard attribute as the first entry and use container_of()
to get at the "parent" object.
(basically poor man's OO inheritance)
-Andi
--
ak@linux.intel.com -- Speaking for myself only
prev parent reply other threads:[~2011-06-29 20:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-29 18:53 using a single sysfs show function for multiple device attributes johnlinn
2011-06-29 20:00 ` Andi Kleen [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=m239is2ysc.fsf@firstfloor.org \
--to=andi@firstfloor.org \
--cc=johnlinn@comcast.net \
--cc=linux-kernel@vger.kernel.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