LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Hoang-Nam Nguyen <hnguyen@linux.vnet.ibm.com>
To: paulus@samba.org, linuxppc-dev@ozlabs.org,
	linux-kernel@vger.kernel.org, johnrose@us.ibm.com,
	Sylvain Munaut <tnt@246tnt.com>
Cc: pmac@au1.ibm.com, fenkes@de.ibm.com
Subject: [PATCH 2.6.21-rc1] ibmebus: Use of_device_uevent()
Date: Sat, 17 Feb 2007 03:56:12 +0100	[thread overview]
Message-ID: <200702170356.12600.hnguyen@linux.vnet.ibm.com> (raw)

This patch replaces ibmebus_uevent() by Sylvain's generic function.


Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
---


 ibmebus.c |   37 +++----------------------------------
 1 file changed, 3 insertions(+), 34 deletions(-)


diff -urp a/arch/powerpc/kernel/ibmebus.c b/arch/powerpc/kernel/ibmebus.c
--- a/arch/powerpc/kernel/ibmebus.c	2007-02-17 03:25:53.403375784 +0100
+++ b/arch/powerpc/kernel/ibmebus.c	2007-02-17 03:27:28.230336112 +0100
@@ -372,41 +372,10 @@ static int ibmebus_bus_match(struct devi
 	return 0;
 }
 
-static int ibmebus_uevent(struct device *dev, char **envp, int num_envp,
-			char *buffer, int buffer_size)
-{
-	const struct ibmebus_dev *ebus_dev = to_ibmebus_dev(dev);
-	char *name, *cp, *loc_code;
-	int length;
-
-	if (!num_envp)
-		return -ENOMEM;
-
-	if (!ebus_dev->ofdev.node)
-		return -ENODEV;
-
-	name = (char *)get_property(ebus_dev->ofdev.node, "name", NULL);
-	cp = (char *)get_property(ebus_dev->ofdev.node, "compatible", NULL);
-	loc_code = (char *)get_property(ebus_dev->ofdev.node,
-					"ibm,loc-code", NULL);
-	if (!(name && cp && loc_code))
-		return -ENODEV;
-
-	envp[0] = buffer;
-	length = scnprintf(buffer, buffer_size,
-			   "MODALIAS=ibmebus:T%s:S%s:L%s",
-			   name, cp, loc_code);
-	if (buffer_size - length <= 0)
-		return -ENOMEM;
-	envp[1] = NULL;
-
-	return 0;
-}
-
 struct bus_type ibmebus_bus_type = {
-	.name = "ibmebus",
-	.uevent = ibmebus_uevent,
-	.match = ibmebus_bus_match,
+	.name   = "ibmebus",
+	.uevent = of_device_uevent,
+	.match  = ibmebus_bus_match,
 };
 EXPORT_SYMBOL(ibmebus_bus_type);
 



             reply	other threads:[~2007-02-17  2:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-17  2:56 Hoang-Nam Nguyen [this message]
2007-02-17  9:36 ` Sylvain Munaut
2007-02-17 15:53   ` Joachim Fenkes

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=200702170356.12600.hnguyen@linux.vnet.ibm.com \
    --to=hnguyen@linux.vnet.ibm.com \
    --cc=fenkes@de.ibm.com \
    --cc=johnrose@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    --cc=pmac@au1.ibm.com \
    --cc=tnt@246tnt.com \
    --subject='Re: [PATCH 2.6.21-rc1] ibmebus: Use of_device_uevent()' \
    /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

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).