On Wed, Jul 07, 2010 at 01:11:34PM -0500, Greg KH wrote: > > > Why do you need it? What is calling that function? What am I missing > > > here? > > > > The function 'pci_create_smbiosname_file' below is calling the .test method. > > For every pdev the function checks if it has a SMBIOS string associated > > with it or not. If there is no string (and instance) associated, then the > > attributes 'label' and 'instance' are not created for that pdev. > > To check for the existance of the string, the .test method is needed and > > it is not available in 'struct device_attribute'. It provides > > .show and .store. We need a .show and .test. So we defined > > {sigh} > > So, you just reinvented the is_visible function in struct > attribute_group? Please use the infrastructure already available to do > this, it saves on code and debugging and review time. I'll take the blame for this. I recommended Narendra use the .test method, as this is what I did back in 2005 in drivers/firmware/edd.c which was one of the earliest consumers of the new sysfs code. James added the is_visible field to attribute groups in 2008, which I missed (only 3 drivers make use of it, so it was easy to miss). Since that's the "new" preferred way to do it, we can adjust this patch accordingly. Thanks, Matt -- Matt Domsch Technology Strategist Dell | Office of the CTO -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html