Re: VPD in sysfs

Dave C Boutcher
2004-08-20T19:45:40Z

On Fri, Aug 20, 2004 at 03:21:43PM +0100, Matthew Wilcox wrote:
> On Sat, Aug 14, 2004 at 07:29:32PM +0100, Matthew Wilcox wrote:
> > Thoughts? Since there's at least four and probably more ways of getting
> > at VPD, we either need to fill in some VPD structs at initialisation or
> > have some kind of vpd_ops that a driver can fill in so the core can get
> > at the data.
>
> I've tried the first option -- creating a large block of sysfs entries for
> all the VPD entries that are present. However, I've come upon a problem
> with sysfs that prevents me from doing so.
>
> Basically, the problem is that sysfs doesn't pass the attribute that's
> being invoked to the attribute ->show method. So I can't determine
> which one is being read. This isn't a problem for any other sysfs attribute
> because they're all static, but for dynamically created attributes, it's
> not possible to work this way.

Ya, I ran into some similar restrictions with a driver I was
writing...after talking to gregkh, you are going to have to go down a
level and use kobjects directly...each piece of data will have a kobject,
and that's what you dereference in the show method.

--
Dave Boutcher