On Wed, 2005-02-09 at 16:04, Chris Wright wrote: > > +#define TPM_DEVICE_ATTRS { \ > > + __ATTR(pubek, S_IRUGO, show_pubek, NULL), \ > > + __ATTR(pcrs, S_IRUGO, show_pcrs, NULL), \ > > + __ATTR(caps, S_IRUGO, show_caps, NULL), \ > > + __ATTR(cancel, S_IWUSR | S_IWGRP, NULL, store_cancel) } > > This doesn't look like the right way to go. > > > + > > struct tpm_chip; > > > > struct tpm_vendor_specific { > > @@ -42,6 +54,7 @@ struct tpm_vendor_specific { > > void (*cancel) (struct tpm_chip *); > > u8 (*status) (struct tpm_chip *); > > struct miscdevice miscdev; > > + struct device_attribute attr[TPM_NUM_ATTR]; > > So every device will have the same attrs? If so, make that whole struct > exported (not the individual show/store methods) and reference that in > each driver. > They are all the same except they have a different owner. What I was trying to do was have them initialized in the tpm specific drivers so that the attribute ownership would be correct but then create them in the generic driver since that was common to all the specific drivers. I could have one copy of the attributes like the one in the mm tree now and change the owner when ever I want to add or remove the attribute. Would that be correct?
Thanks, Kylie > thanks, > -chris - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/