linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Josh Boyer <jwboyer@gmail.com>
To: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 0/4] Fedora kernel patch review
Date: Fri, 5 Feb 2010 08:53:54 -0500	[thread overview]
Message-ID: <20100205135354.GI12001@hansolo.jdub.homelinux.org> (raw)
In-Reply-To: <20100205133552.GF12001@hansolo.jdub.homelinux.org>

Provide a modalias entry for VIO devices in sysfs.  I believe
this was another initrd generation bugfix for anaconda.

---
 
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index f988672..12a0851 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -294,9 +294,27 @@ static ssize_t devspec_show(struct device *dev,
 	return sprintf(buf, "%s\n", of_node ? of_node->full_name : "none");
 }
 
+static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
+			     char *buf)
+{
+	const struct vio_dev *vio_dev = to_vio_dev(dev);
+	struct device_node *dn;
+	const char *cp;
+
+	dn = dev->archdata.of_node;
+	if (!dn)
+		return -ENODEV;
+	cp = of_get_property(dn, "compatible", NULL);
+	if (!cp)
+		return -ENODEV;
+
+	return sprintf(buf, "vio:T%sS%s\n", vio_dev->type, cp);
+}
+
 static struct device_attribute vio_dev_attrs[] = {
 	__ATTR_RO(name),
 	__ATTR_RO(devspec),
+	__ATTR_RO(modalias),
 	__ATTR_NULL
 };

  parent reply	other threads:[~2010-02-05 13:54 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-05 13:35 [PATCH 0/4] Fedora kernel patch review Josh Boyer
2010-02-05 13:42 ` [PATCH 1/4] Add ps3_storage module alias Josh Boyer
2010-02-05 13:49   ` Geert Uytterhoeven
2010-02-05 14:03     ` Josh Boyer
2010-02-05 14:39       ` Geert Uytterhoeven
2010-02-23 12:47     ` David Woodhouse
2010-02-05 13:52 ` [PATCH 2/4] Fix G5 thermal shutdown Josh Boyer
2010-02-09  0:55   ` Benjamin Herrenschmidt
2010-02-09  2:06     ` Josh Boyer
2010-02-23 12:48     ` David Woodhouse
2010-02-24  2:54       ` Benjamin Herrenschmidt
2010-02-05 13:53 ` Josh Boyer [this message]
2010-02-05 13:59   ` [PATCH 0/4] Fedora kernel patch review Josh Boyer
2010-02-23 12:50   ` [PATCH 3/4] Provide VIO modalias David Woodhouse
2010-02-24  0:05     ` Brian King
2010-02-05 13:55 ` [PATCH 4/4] Fix iMac iSight PCI bridge setup Josh Boyer
2010-02-05 20:57   ` Benjamin Herrenschmidt
2010-02-06  1:03     ` Josh Boyer
2010-02-06  1:48       ` Benjamin Herrenschmidt
2010-02-23 12:50       ` David Woodhouse
2010-02-05 14:04 ` [PATCH 0/4] Fedora kernel patch review Josh Boyer

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=20100205135354.GI12001@hansolo.jdub.homelinux.org \
    --to=jwboyer@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /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;
as well as URLs for NNTP newsgroup(s).