Re: [PATCH 1/2] Export firmware assigned labels of network devices to sysfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 07, 2010 at 12:48:26PM -0500, Narendra K wrote:
> > -----Original Message-----
> > From: Greg KH [mailto:greg@xxxxxxxxx] 
> > Sent: Wednesday, July 07, 2010 4:52 AM
> > To: K, Narendra
> > Cc: netdev@xxxxxxxxxxxxxxx; linux-hotplug@xxxxxxxxxxxxxxx;
> > linux-pci@xxxxxxxxxxxxxxx; Domsch, Matt; Hargrave, Jordan; Rose,
> > Charles; Nijhawan, Vijay
> > Subject: Re: [PATCH 1/2] Export firmware assigned labels of network
> > devices to sysfs
> > 
> > On Tue, Jul 06, 2010 at 01:52:18PM -0500, Narendra K wrote:
> > > 
> > > 'device_create_file' takes 'struct device_attribute *' as a param
> > which 
> > > we have not used here because  'struct device_attribute' does not have
> > .test
> > > member which we needed in this patch.
> > 
> > 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.

thanks,

greg k-h
--
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


[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux