linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] [SPARC/64] Consolidate of_register_driver
@ 2007-10-17  3:41 Stephen Rothwell
  2007-10-17  3:43 ` [PATCH 2/2] [POWERPC] Use of_register_driver to implement of_register_platform_driver Stephen Rothwell
  2007-10-18  4:18 ` [PATCH 1/2] [SPARC/64] Consolidate of_register_driver David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Stephen Rothwell @ 2007-10-17  3:41 UTC (permalink / raw)
  To: David S. Miller; +Cc: sparclinux, ppc-dev, wli

Also of_unregister_driver.  These will be shortly also used by the
PowerPC code.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/sparc/kernel/of_device.c     |   20 --------------------
 arch/sparc64/kernel/of_device.c   |   20 --------------------
 drivers/of/platform.c             |   21 +++++++++++++++++++++
 include/asm-sparc/of_platform.h   |    5 +----
 include/asm-sparc64/of_platform.h |    5 +----
 include/linux/of_platform.h       |    4 ++++
 6 files changed, 27 insertions(+), 48 deletions(-)

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --git a/arch/sparc/kernel/of_device.c b/arch/sparc/kernel/of_device.c
index fb2caef..3ea000d 100644
--- a/arch/sparc/kernel/of_device.c
+++ b/arch/sparc/kernel/of_device.c
@@ -585,24 +585,6 @@ static int __init of_debug(char *str)
 
 __setup("of_debug=", of_debug);
 
-int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus)
-{
-	/* initialize common driver fields */
-	if (!drv->driver.name)
-		drv->driver.name = drv->name;
-	if (!drv->driver.owner)
-		drv->driver.owner = drv->owner;
-	drv->driver.bus = bus;
-
-	/* register with core */
-	return driver_register(&drv->driver);
-}
-
-void of_unregister_driver(struct of_platform_driver *drv)
-{
-	driver_unregister(&drv->driver);
-}
-
 struct of_device* of_platform_device_create(struct device_node *np,
 					    const char *bus_id,
 					    struct device *parent,
@@ -628,6 +610,4 @@ struct of_device* of_platform_device_create(struct device_node *np,
 	return dev;
 }
 
-EXPORT_SYMBOL(of_register_driver);
-EXPORT_SYMBOL(of_unregister_driver);
 EXPORT_SYMBOL(of_platform_device_create);
diff --git a/arch/sparc64/kernel/of_device.c b/arch/sparc64/kernel/of_device.c
index 42d7798..fc5c0cc 100644
--- a/arch/sparc64/kernel/of_device.c
+++ b/arch/sparc64/kernel/of_device.c
@@ -869,26 +869,6 @@ static int __init of_debug(char *str)
 
 __setup("of_debug=", of_debug);
 
-int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus)
-{
-	/* initialize common driver fields */
-	if (!drv->driver.name)
-		drv->driver.name = drv->name;
-	if (!drv->driver.owner)
-		drv->driver.owner = drv->owner;
-	drv->driver.bus = bus;
-
-	/* register with core */
-	return driver_register(&drv->driver);
-}
-EXPORT_SYMBOL(of_register_driver);
-
-void of_unregister_driver(struct of_platform_driver *drv)
-{
-	driver_unregister(&drv->driver);
-}
-EXPORT_SYMBOL(of_unregister_driver);
-
 struct of_device* of_platform_device_create(struct device_node *np,
 					    const char *bus_id,
 					    struct device *parent,
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 864f09f..b47bb2d 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -12,6 +12,7 @@
  *
  */
 #include <linux/errno.h>
+#include <linux/module.h>
 #include <linux/device.h>
 #include <linux/of_device.h>
 #include <linux/of_platform.h>
@@ -94,3 +95,23 @@ int of_bus_type_init(struct bus_type *bus, const char *name)
 	bus->resume = of_platform_device_resume;
 	return bus_register(bus);
 }
+
+int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus)
+{
+	/* initialize common driver fields */
+	if (!drv->driver.name)
+		drv->driver.name = drv->name;
+	if (!drv->driver.owner)
+		drv->driver.owner = drv->owner;
+	drv->driver.bus = bus;
+
+	/* register with core */
+	return driver_register(&drv->driver);
+}
+EXPORT_SYMBOL(of_register_driver);
+
+void of_unregister_driver(struct of_platform_driver *drv)
+{
+	driver_unregister(&drv->driver);
+}
+EXPORT_SYMBOL(of_unregister_driver);
diff --git a/include/asm-sparc/of_platform.h b/include/asm-sparc/of_platform.h
index 64a2300..d638737 100644
--- a/include/asm-sparc/of_platform.h
+++ b/include/asm-sparc/of_platform.h
@@ -18,12 +18,9 @@
 
 extern struct bus_type ebus_bus_type;
 extern struct bus_type sbus_bus_type;
-extern struct bus_type of_platform_bus_type;
+
 #define of_bus_type	of_platform_bus_type	/* for compatibility */
 
-extern int of_register_driver(struct of_platform_driver *drv,
-			      struct bus_type *bus);
-extern void of_unregister_driver(struct of_platform_driver *drv);
 extern struct of_device *of_platform_device_create(struct device_node *np,
 						   const char *bus_id,
 						   struct device *parent,
diff --git a/include/asm-sparc64/of_platform.h b/include/asm-sparc64/of_platform.h
index f7c1f17..f15cfa7 100644
--- a/include/asm-sparc64/of_platform.h
+++ b/include/asm-sparc64/of_platform.h
@@ -19,12 +19,9 @@
 extern struct bus_type isa_bus_type;
 extern struct bus_type ebus_bus_type;
 extern struct bus_type sbus_bus_type;
-extern struct bus_type of_platform_bus_type;
+
 #define of_bus_type	of_platform_bus_type	/* for compatibility */
 
-extern int of_register_driver(struct of_platform_driver *drv,
-			      struct bus_type *bus);
-extern void of_unregister_driver(struct of_platform_driver *drv);
 extern struct of_device *of_platform_device_create(struct device_node *np,
 						   const char *bus_id,
 						   struct device *parent,
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index 448f70b..a8efcfe 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -48,6 +48,10 @@ struct of_platform_driver
 #define	to_of_platform_driver(drv) \
 	container_of(drv,struct of_platform_driver, driver)
 
+extern int of_register_driver(struct of_platform_driver *drv,
+			      struct bus_type *bus);
+extern void of_unregister_driver(struct of_platform_driver *drv);
+
 #include <asm/of_platform.h>
 
 extern struct of_device *of_find_device_by_node(struct device_node *np);
-- 
1.5.3.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] [POWERPC] Use of_register_driver to implement of_register_platform_driver
  2007-10-17  3:41 [PATCH 1/2] [SPARC/64] Consolidate of_register_driver Stephen Rothwell
@ 2007-10-17  3:43 ` Stephen Rothwell
  2007-10-18  4:18 ` [PATCH 1/2] [SPARC/64] Consolidate of_register_driver David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: Stephen Rothwell @ 2007-10-17  3:43 UTC (permalink / raw)
  To: paulus; +Cc: sparclinux, ppc-dev, David S. Miller, wli

Also of_unregister{,_platform}_driver.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/powerpc/kernel/of_platform.c |   20 --------------------
 include/asm-powerpc/of_platform.h |   10 ++++++++--
 2 files changed, 8 insertions(+), 22 deletions(-)

This depends on the Sparc part (patch 1/2) being in the tree first.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --git a/arch/powerpc/kernel/of_platform.c b/arch/powerpc/kernel/of_platform.c
index eca8ccc..9b01602 100644
--- a/arch/powerpc/kernel/of_platform.c
+++ b/arch/powerpc/kernel/of_platform.c
@@ -67,26 +67,6 @@ static int __init of_bus_driver_init(void)
 
 postcore_initcall(of_bus_driver_init);
 
-int of_register_platform_driver(struct of_platform_driver *drv)
-{
-	/* initialize common driver fields */
-	if (!drv->driver.name)
-		drv->driver.name = drv->name;
-	if (!drv->driver.owner)
-		drv->driver.owner = drv->owner;
-	drv->driver.bus = &of_platform_bus_type;
-
-	/* register with core */
-	return driver_register(&drv->driver);
-}
-EXPORT_SYMBOL(of_register_platform_driver);
-
-void of_unregister_platform_driver(struct of_platform_driver *drv)
-{
-	driver_unregister(&drv->driver);
-}
-EXPORT_SYMBOL(of_unregister_platform_driver);
-
 static void of_platform_make_bus_id(struct of_device *dev)
 {
 	struct device_node *node = dev->node;
diff --git a/include/asm-powerpc/of_platform.h b/include/asm-powerpc/of_platform.h
index 80e6fad..d20a4cd 100644
--- a/include/asm-powerpc/of_platform.h
+++ b/include/asm-powerpc/of_platform.h
@@ -15,8 +15,14 @@
 #include <linux/of_platform.h>
 
 /* Platform drivers register/unregister */
-extern int of_register_platform_driver(struct of_platform_driver *drv);
-extern void of_unregister_platform_driver(struct of_platform_driver *drv);
+static inline int of_register_platform_driver(struct of_platform_driver *drv)
+{
+	return of_register_driver(drv, &of_platform_bus_type);
+}
+static inline void of_unregister_platform_driver(struct of_platform_driver *drv)
+{
+	of_unregister_driver(drv);
+}
 
 /* Platform devices and busses creation */
 extern struct of_device *of_platform_device_create(struct device_node *np,
-- 
1.5.3.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] [SPARC/64] Consolidate of_register_driver
  2007-10-17  3:41 [PATCH 1/2] [SPARC/64] Consolidate of_register_driver Stephen Rothwell
  2007-10-17  3:43 ` [PATCH 2/2] [POWERPC] Use of_register_driver to implement of_register_platform_driver Stephen Rothwell
@ 2007-10-18  4:18 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2007-10-18  4:18 UTC (permalink / raw)
  To: sfr; +Cc: sparclinux, linuxppc-dev, wli

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Wed, 17 Oct 2007 13:41:23 +1000

> Also of_unregister_driver.  These will be shortly also used by the
> PowerPC code.
> 
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>

I'll apply this and push it onward, thanks Stephen!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] [POWERPC] Use of_register_driver to implement of_register_platform_driver
@ 2007-12-04  3:11 Stephen Rothwell
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Rothwell @ 2007-12-04  3:11 UTC (permalink / raw)
  To: paulus; +Cc: ppc-dev

[-- Attachment #1: Type: text/plain, Size: 221 bytes --]

Hi Paul,

Is there some reason http://patchwork.ozlabs.org/linuxppc/patch?id=14223
should not be in 2.6.25?

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-12-04  3:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-17  3:41 [PATCH 1/2] [SPARC/64] Consolidate of_register_driver Stephen Rothwell
2007-10-17  3:43 ` [PATCH 2/2] [POWERPC] Use of_register_driver to implement of_register_platform_driver Stephen Rothwell
2007-10-18  4:18 ` [PATCH 1/2] [SPARC/64] Consolidate of_register_driver David Miller
  -- strict thread matches above, loose matches on Subject: below --
2007-12-04  3:11 [PATCH 2/2] [POWERPC] Use of_register_driver to implement of_register_platform_driver Stephen Rothwell

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