Re: using a single sysfs show function for multiple device attributes

From: Andi Kleen
Date: Wed Jun 29 2011 - 16:02:14 EST


johnlinn@xxxxxxxxxxx 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@xxxxxxxxxxxxxxx -- Speaking for myself only
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/