[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Wed, 7 Jul 2010 13:35:59 -0500
From: "Domsch, Matt" <Matt_Domsch@...l.com>
To: Greg KH <greg@...ah.com>
Cc: "K, Narendra" <Narendra_K@...l.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-hotplug@...r.kernel.org" <linux-hotplug@...r.kernel.org>,
"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
"Hargrave, Jordan" <Jordan_Hargrave@...l.com>,
"Rose, Charles" <Charles_Rose@...l.com>,
"Nijhawan, Vijay" <Vijay_Nijhawan@...l.com>
Subject: Re: [PATCH 1/2] Export firmware assigned labels of network devices
to sysfs
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 netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists