From: Greg KH <greg@kroah.com>
To: Narendra K <Narendra_K@dell.com>
Cc: matt_domsch@dell.com, netdev@vger.kernel.org,
linux-hotplug@vger.kernel.org, linux-pci@vger.kernel.org,
jordan_hargrave@dell.com, charles_rose@dell.com,
vijay_nijhawan@dell.com
Subject: Re: [PATCH 1/2] Export firmware assigned labels of network devices
Date: Wed, 30 Jun 2010 15:42:20 +0000 [thread overview]
Message-ID: <20100630154220.GA12045@kroah.com> (raw)
In-Reply-To: <20100629162818.GA17099@auslistsprd01.us.dell.com>
On Tue, Jun 29, 2010 at 11:28:18AM -0500, Narendra K wrote:
> --- a/drivers/pci/Makefile
> +++ b/drivers/pci/Makefile
> @@ -4,7 +4,7 @@
>
> obj-y += access.o bus.o probe.o remove.o pci.o \
> pci-driver.o search.o pci-sysfs.o rom.o setup-res.o \
> - irq.o vpd.o
> + irq.o vpd.o pci-label.o
No, only build this if CONFIG_DMI is set.
> diff --git a/drivers/pci/pci-label.c b/drivers/pci/pci-label.c
> new file mode 100644
> index 0000000..0f824d6
> --- /dev/null
> +++ b/drivers/pci/pci-label.c
> @@ -0,0 +1,140 @@
> +/*
> + * Purpose: Export the firmware instance/index and label associated with
> + * a pci device to sysfs
> + * Copyright (C) 2010 Dell Inc.
> + * by Narendra K <Narendra_K@dell.com>, Jordan Hargrave <Jordan_Hargrave@dell.com>
> + *
> + * SMBIOS defines type 41 for onboard pci devices. This code retrieves
> + * the instance number and string from the type 41 record and exports
> + * it to sysfs.
> + *
> + * Please see http://linux.dell.com/wiki/index.php/Oss/libnetdevname for more
> + * information.
> + */
> +
> +#include <linux/dmi.h>
> +#include <linux/sysfs.h>
> +#include <linux/pci.h>
> +#include <linux/pci_ids.h>
> +#include <linux/module.h>
> +#include "pci.h"
> +
> +#ifndef CONFIG_DMI
> +
> +static inline int
> +pci_create_smbiosname_file(struct pci_dev *pdev)
> +{
> + return -1;
> +}
> +
> +static inline int
> +pci_remove_smbiosname_file(struct pci_dev *pdev)
> +{
> + return -1;
> +}
> +
> +#else
The above Makefile change will allow you to remove these, right? You
don't want to create the files if there is nothing that can be in them,
right?
> +pci_create_smbiosname_file(struct pci_dev *pdev)
> +{
> + if (smbios_attr_label.test && smbios_attr_label.test(&pdev->dev, NULL, NULL)) {
> + if (sysfs_create_file(&pdev->dev.kobj, &smbios_attr_label.attr))
> + return -1;
What's wrong with the 'device_create_file' calls?
thanks,
greg k-h
WARNING: multiple messages have this Message-ID (diff)
From: Greg KH <greg@kroah.com>
To: Narendra K <Narendra_K@dell.com>
Cc: matt_domsch@dell.com, netdev@vger.kernel.org,
linux-hotplug@vger.kernel.org, linux-pci@vger.kernel.org,
jordan_hargrave@dell.com, charles_rose@dell.com,
vijay_nijhawan@dell.com
Subject: Re: [PATCH 1/2] Export firmware assigned labels of network devices to sysfs
Date: Wed, 30 Jun 2010 08:42:20 -0700 [thread overview]
Message-ID: <20100630154220.GA12045@kroah.com> (raw)
In-Reply-To: <20100629162818.GA17099@auslistsprd01.us.dell.com>
On Tue, Jun 29, 2010 at 11:28:18AM -0500, Narendra K wrote:
> --- a/drivers/pci/Makefile
> +++ b/drivers/pci/Makefile
> @@ -4,7 +4,7 @@
>
> obj-y += access.o bus.o probe.o remove.o pci.o \
> pci-driver.o search.o pci-sysfs.o rom.o setup-res.o \
> - irq.o vpd.o
> + irq.o vpd.o pci-label.o
No, only build this if CONFIG_DMI is set.
> diff --git a/drivers/pci/pci-label.c b/drivers/pci/pci-label.c
> new file mode 100644
> index 0000000..0f824d6
> --- /dev/null
> +++ b/drivers/pci/pci-label.c
> @@ -0,0 +1,140 @@
> +/*
> + * Purpose: Export the firmware instance/index and label associated with
> + * a pci device to sysfs
> + * Copyright (C) 2010 Dell Inc.
> + * by Narendra K <Narendra_K@dell.com>, Jordan Hargrave <Jordan_Hargrave@dell.com>
> + *
> + * SMBIOS defines type 41 for onboard pci devices. This code retrieves
> + * the instance number and string from the type 41 record and exports
> + * it to sysfs.
> + *
> + * Please see http://linux.dell.com/wiki/index.php/Oss/libnetdevname for more
> + * information.
> + */
> +
> +#include <linux/dmi.h>
> +#include <linux/sysfs.h>
> +#include <linux/pci.h>
> +#include <linux/pci_ids.h>
> +#include <linux/module.h>
> +#include "pci.h"
> +
> +#ifndef CONFIG_DMI
> +
> +static inline int
> +pci_create_smbiosname_file(struct pci_dev *pdev)
> +{
> + return -1;
> +}
> +
> +static inline int
> +pci_remove_smbiosname_file(struct pci_dev *pdev)
> +{
> + return -1;
> +}
> +
> +#else
The above Makefile change will allow you to remove these, right? You
don't want to create the files if there is nothing that can be in them,
right?
> +pci_create_smbiosname_file(struct pci_dev *pdev)
> +{
> + if (smbios_attr_label.test && smbios_attr_label.test(&pdev->dev, NULL, NULL)) {
> + if (sysfs_create_file(&pdev->dev.kobj, &smbios_attr_label.attr))
> + return -1;
What's wrong with the 'device_create_file' calls?
thanks,
greg k-h
next prev parent reply other threads:[~2010-06-30 15:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <EDA0A4495861324DA2618B4C45DCB3EE612AB6@blrx3m08.blr.amer.dell.com>
2010-06-29 16:28 ` [PATCH 1/2] Export firmware assigned labels of network devices to sysfs Narendra K
2010-06-29 16:28 ` Narendra K
2010-06-30 15:42 ` Greg KH [this message]
2010-06-30 15:42 ` Greg KH
[not found] <EDA0A4495861324DA2618B4C45DCB3EE612B27@blrx3m08.blr.amer.dell.com>
2010-07-07 17:48 ` Narendra K
2010-07-07 18:11 ` [PATCH 1/2] Export firmware assigned labels of network devices Greg KH
2010-07-07 18:35 ` Domsch, Matt
[not found] <EDA0A4495861324DA2618B4C45DCB3EE612B1B@blrx3m08.blr.amer.dell.com>
2010-07-06 18:52 ` [PATCH 1/2] Export firmware assigned labels of network devices to sysfs Narendra K
2010-07-06 23:22 ` [PATCH 1/2] Export firmware assigned labels of network devices Greg KH
2010-05-28 11:55 [PATCH 1/2] Export firmware assigned labels of network devices to K, Narendra
2010-05-28 13:16 ` [PATCH 1/2] Export firmware assigned labels of network devices Domsch, Matt
2010-05-28 15:40 ` Greg KH
2010-05-28 18:11 ` [PATCH 1/2] Export firmware assigned labels of network devices to sysfs Matt Domsch
2010-05-28 22:27 ` [PATCH 1/2] Export firmware assigned labels of network devices Greg KH
2010-05-29 4:51 ` Domsch, Matt
2010-06-09 4:17 ` [PATCH 1/2] Export firmware assigned labels of network devices to sysfs Matt Domsch
2010-06-09 15:02 ` [PATCH 1/2] Export firmware assigned labels of network devices Greg KH
2010-05-31 14:07 ` Michael Ellerman
2010-05-31 18:54 ` [PATCH 1/2] Export firmware assigned labels of network devices to sysfs Narendra_K
2010-06-02 23:54 ` [PATCH 1/2] Export firmware assigned labels of network devices Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100630154220.GA12045@kroah.com \
--to=greg@kroah.com \
--cc=Narendra_K@dell.com \
--cc=charles_rose@dell.com \
--cc=jordan_hargrave@dell.com \
--cc=linux-hotplug@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=matt_domsch@dell.com \
--cc=netdev@vger.kernel.org \
--cc=vijay_nijhawan@dell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.