[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <m239is2ysc.fsf@firstfloor.org>
Date: Wed, 29 Jun 2011 13:00:35 -0700
From: Andi Kleen <andi@...stfloor.org>
To: johnlinn@...cast.net
Cc: linux-kernel@...r.kernel.org
Subject: Re: using a single sysfs show function for multiple device attributes
johnlinn@...cast.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@...ux.intel.com -- Speaking for myself only
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists