using a single sysfs show function for multiple device attributes

From: johnlinn
Date: Wed Jun 29 2011 - 14:54:00 EST


In a platform driver, I'm trying to use a single function for multiple device attributes and use the attr input to ID which attribute.

After the driver is up and running, the sysfs attributes exist. In my show function getting a device_attribute as an input, I never see the device attribute (attr) having anything in it (all 0s). I see the attr pointer be valid, but pointing to all 0's.

I don't see others using the attr input, but it seems like the way to ID which attribute is being accessed so that one show function can be used for many attributes.

I'm sure it's obvious, but I don't see what I'm doing wrong.

Thanks,
John
--
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/