public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, linux-pci@atrey.karlin.mff.cuni.cz
Cc: gregkh@suse.de
Subject: [PATCH] PCI: add modalias sysfs file for pci devices
Date: Tue, 17 May 2005 14:45:06 -0700	[thread overview]
Message-ID: <11163663063114@kroah.com> (raw)
In-Reply-To: <1116366306935@kroah.com>

[PATCH] PCI: add modalias sysfs file for pci devices

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
commit 9888549e0507cc95d1d7ade1595c00ff8e902659
tree 9c31d2b34ef9b747733f7f39916a8031f89c3d1e
parent c22610dadc0452b1273494f2b5157123c6cd60e1
author Greg KH <gregkh@suse.de> Thu, 05 May 2005 11:57:25 -0700
committer Greg KH <gregkh@suse.de> Tue, 17 May 2005 14:31:12 -0700

 drivers/pci/pci-sysfs.c |   12 ++++++++++++
 1 files changed, 12 insertions(+)

Index: drivers/pci/pci-sysfs.c
===================================================================
--- 150d5315df21f02605ad5a6541ef7cb00176d023/drivers/pci/pci-sysfs.c  (mode:100644)
+++ 9c31d2b34ef9b747733f7f39916a8031f89c3d1e/drivers/pci/pci-sysfs.c  (mode:100644)
@@ -73,6 +73,17 @@
 	return (str - buf);
 }
 
+static ssize_t modalias_show(struct device *dev, char *buf)
+{
+	struct pci_dev *pci_dev = to_pci_dev(dev);
+
+	return sprintf(buf, "pci:v%08Xd%08Xsv%08Xsd%08Xbc%02Xsc%02Xi%02x\n",
+		       pci_dev->vendor, pci_dev->device,
+		       pci_dev->subsystem_vendor, pci_dev->subsystem_device,
+		       (u8)(pci_dev->class >> 16), (u8)(pci_dev->class >> 8),
+		       (u8)(pci_dev->class));
+}
+
 struct device_attribute pci_dev_attrs[] = {
 	__ATTR_RO(resource),
 	__ATTR_RO(vendor),
@@ -82,6 +93,7 @@
 	__ATTR_RO(class),
 	__ATTR_RO(irq),
 	__ATTR_RO(local_cpus),
+	__ATTR_RO(modalias),
 	__ATTR_NULL,
 };
 


  reply	other threads:[~2005-05-17 21:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-17 21:44 [GIT PATCH] PCI bugfixes for 2.6.12-rc4 Greg KH
2005-05-17 21:45 ` [PATCH] PCI Hotplug: Fix echoing 1 to power file of enabled slot problem with SHPC driver Greg KH
2005-05-17 21:45   ` [PATCH] PCI Hotplug: CPCI update Greg KH
2005-05-17 21:45     ` [PATCH] PCI Hotplug: get pciehp to work on the downstream port of a switch Greg KH
2005-05-17 21:45       ` [PATCH] PCI Hotplug: remove pci_visit_dev Greg KH
2005-05-17 21:45         ` Greg KH [this message]
2005-05-17 21:45           ` [PATCH] PCI: add MODALIAS to hotplug event for pci devices Greg KH
2005-05-31 16:50           ` [PATCH] PCI: add modalias sysfs file " Michael Tokarev
2005-06-01 21:36             ` Greg KH

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=11163663063114@kroah.com \
    --to=gregkh@suse.de \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@atrey.karlin.mff.cuni.cz \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox