linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* PATCH: rename legacy bus to platform bus
@ 2003-10-23 15:11 Jamey Hicks
  2003-10-24  6:51 ` H. Peter Anvin
  2003-10-27 22:46 ` Patrick Mochel
  0 siblings, 2 replies; 5+ messages in thread
From: Jamey Hicks @ 2003-10-23 15:11 UTC (permalink / raw)
  To: mochel; +Cc: linux-kernel

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


Many of us, especially in the embedded computing world, think that 
"legacy bus" is a misnomer.  It's not going away.  What do root PCI 
buses connect to?  At the root of the device tree there is a bus.  This 
patch changes the name from legacy bus to platform bus.  I'm hoping this 
change can be made even this late in the development cycle.  It is a 
pretty small patch but I think that naming is very important.

-Jamey Hicks




[-- Attachment #2: platform-bus.patch --]
[-- Type: text/plain, Size: 2737 bytes --]

--- linux-2.6.0-test8-rmk1/drivers/base/platform.c	2003-09-27 20:50:09.000000000 -0400
+++ kernel26/drivers/base/platform.c	2003-10-23 10:50:03.226877352 -0400
@@ -14,8 +14,8 @@
 #include <linux/module.h>
 #include <linux/init.h>
 
-struct device legacy_bus = {
-	.bus_id		= "legacy",
+struct device platform_bus = {
+	.bus_id		= "platform",
 };
 
 /**
@@ -29,7 +29,7 @@
 		return -EINVAL;
 
 	if (!pdev->dev.parent)
-		pdev->dev.parent = &legacy_bus;
+		pdev->dev.parent = &platform_bus;
 
 	pdev->dev.bus = &platform_bus_type;
 	
@@ -105,12 +105,12 @@
 
 int __init platform_bus_init(void)
 {
-	device_register(&legacy_bus);
+	device_register(&platform_bus);
 	return bus_register(&platform_bus_type);
 }
 
-EXPORT_SYMBOL(legacy_bus);
+EXPORT_SYMBOL(platform_bus);
 EXPORT_SYMBOL(platform_bus_type);
 EXPORT_SYMBOL(platform_device_register);
 EXPORT_SYMBOL(platform_device_unregister);
--- linux-2.6.0-test8-rmk1/drivers/i2c/i2c-core.c	2003-09-27 20:50:10.000000000 -0400
+++ kernel26/drivers/i2c/i2c-core.c	2003-10-23 10:51:52.070330632 -0400
@@ -136,11 +136,11 @@
 
 	/* Add the adapter to the driver core.
 	 * If the parent pointer is not set up,
-	 * we add this adapter to the legacy bus.
+	 * we add this adapter to the platform bus.
 	 */
 	if (adap->dev.parent == NULL)
-		adap->dev.parent = &legacy_bus;
+		adap->dev.parent = &platform_bus;
 	sprintf(adap->dev.bus_id, "i2c-%d", adap->nr);
 	adap->dev.driver = &i2c_adapter_driver;
 	adap->dev.release = &i2c_adapter_dev_release;
--- linux-2.6.0-test8-rmk1/drivers/i2c/i2c-dev.c	2003-10-19 23:23:05.000000000 -0400
+++ kernel26/drivers/i2c/i2c-dev.c	2003-10-23 10:52:08.964762288 -0400
@@ -447,8 +447,8 @@
 
 	/* register this i2c device with the driver core */
 	i2c_dev->adap = adap;
-	if (adap->dev.parent == &legacy_bus)
+	if (adap->dev.parent == &platform_bus)
 		i2c_dev->class_dev.dev = &adap->dev;
 	else
 		i2c_dev->class_dev.dev = adap->dev.parent;
--- linux-2.6.0-test8-rmk1/drivers/scsi/hosts.c	2003-09-27 20:50:07.000000000 -0400
+++ kernel26/drivers/scsi/hosts.c	2003-10-23 10:52:20.152061560 -0400
@@ -111,8 +111,8 @@
 	}
 
 	if (!shost->shost_gendev.parent)
-		shost->shost_gendev.parent = dev ? dev : &legacy_bus;
+		shost->shost_gendev.parent = dev ? dev : &platform_bus;
 
 	error = device_add(&shost->shost_gendev);
 	if (error)
--- linux-2.6.0-test8-rmk1/include/linux/device.h	2003-10-19 23:23:11.000000000 -0400
+++ kernel26/include/linux/device.h	2003-10-23 10:56:56.250088280 -0400
@@ -372,7 +372,7 @@
 extern void platform_device_unregister(struct platform_device *);
 
 extern struct bus_type platform_bus_type;
-extern struct device legacy_bus;
+extern struct device platform_bus;
 
 /* drivers/base/power.c */
 extern void device_shutdown(void);

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

* Re: PATCH: rename legacy bus to platform bus
  2003-10-23 15:11 PATCH: rename legacy bus to platform bus Jamey Hicks
@ 2003-10-24  6:51 ` H. Peter Anvin
  2003-10-27 22:46 ` Patrick Mochel
  1 sibling, 0 replies; 5+ messages in thread
From: H. Peter Anvin @ 2003-10-24  6:51 UTC (permalink / raw)
  To: linux-kernel

Followup to:  <3F97EF84.2060901@hp.com>
By author:    Jamey Hicks <jamey.hicks@hp.com>
In newsgroup: linux.dev.kernel
> 
> Many of us, especially in the embedded computing world, think that 
> "legacy bus" is a misnomer.  It's not going away.  What do root PCI 
> buses connect to?  At the root of the device tree there is a bus.  This 
> patch changes the name from legacy bus to platform bus.  I'm hoping this 
> change can be made even this late in the development cycle.  It is a 
> pretty small patch but I think that naming is very important.
> 

>From a PCI terminology perspective, this is misleading.

The root PCI bus connects to a HOST bus.

The LEGACY bus connects to the subtractive decoding device.

In a PC system, LEGACY busses are basically ISA and LPC.

	-hpa
-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
If you send me mail in HTML format I will assume it's spam.
"Unix gives you enough rope to shoot yourself in the foot."
Architectures needed: ia64 m68k mips64 ppc ppc64 s390 s390x sh v850 x86-64

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

* Re: PATCH: rename legacy bus to platform bus
  2003-10-23 15:11 PATCH: rename legacy bus to platform bus Jamey Hicks
  2003-10-24  6:51 ` H. Peter Anvin
@ 2003-10-27 22:46 ` Patrick Mochel
  2003-10-28 18:12   ` Jamey Hicks
  1 sibling, 1 reply; 5+ messages in thread
From: Patrick Mochel @ 2003-10-27 22:46 UTC (permalink / raw)
  To: Jamey Hicks; +Cc: linux-kernel


> Many of us, especially in the embedded computing world, think that 
> "legacy bus" is a misnomer.  It's not going away.  What do root PCI 
> buses connect to?  At the root of the device tree there is a bus.  This 
> patch changes the name from legacy bus to platform bus.  I'm hoping this 
> change can be made even this late in the development cycle.  It is a 
> pretty small patch but I think that naming is very important.

Thanks, I've been meaning to fix it for some time. However, it didn't 
apply: 

patching file drivers/base/platform.c
Hunk #3 FAILED at 105.
Hunk #4 FAILED at 136.
Hunk #5 FAILED at 447.
Hunk #6 FAILED at 111.
Hunk #7 FAILED at 372.
5 out of 7 hunks FAILED -- saving rejects to file 
drivers/base/platform.c.rej

Care to fix it? 

Thanks,


	Pat


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

* Re: PATCH: rename legacy bus to platform bus
  2003-10-27 22:46 ` Patrick Mochel
@ 2003-10-28 18:12   ` Jamey Hicks
  2003-10-28 18:24     ` Patrick Mochel
  0 siblings, 1 reply; 5+ messages in thread
From: Jamey Hicks @ 2003-10-28 18:12 UTC (permalink / raw)
  To: Patrick Mochel; +Cc: linux-kernel

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

On Mon, 2003-10-27 at 17:46, Patrick Mochel wrote:
> > Many of us, especially in the embedded computing world, think that 
> > "legacy bus" is a misnomer.  It's not going away.  What do root PCI 
> > buses connect to?  At the root of the device tree there is a bus.  This 
> > patch changes the name from legacy bus to platform bus.  I'm hoping this 
> > change can be made even this late in the development cycle.  It is a 
> > pretty small patch but I think that naming is very important.
> 
> Thanks, I've been meaning to fix it for some time. However, it didn't 
> apply: 
> 
> patching file drivers/base/platform.c
> Hunk #3 FAILED at 105.
> Hunk #4 FAILED at 136.
> Hunk #5 FAILED at 447.
> Hunk #6 FAILED at 111.
> Hunk #7 FAILED at 372.
> 5 out of 7 hunks FAILED -- saving rejects to file 
> drivers/base/platform.c.rej
> 

Regenerated from a cleanly modified 2.6.0-test9 tree.

Jamey


[-- Attachment #2: platform-bus.patch --]
[-- Type: text/x-patch, Size: 3555 bytes --]

diff -urN -X dontdiff linux-2.6.0-test9/drivers/base/platform.c linux-2.6.0-test9-jeh1/drivers/base/platform.c
--- linux-2.6.0-test9/drivers/base/platform.c	2003-10-25 14:42:57.000000000 -0400
+++ linux-2.6.0-test9-jeh1/drivers/base/platform.c	2003-10-28 13:04:06.000000000 -0500
@@ -1,5 +1,5 @@
 /*
- * platform.c - platform 'psuedo' bus for legacy devices
+ * platform.c - platform 'psuedo' bus for root devices
  *
  * Copyright (c) 2002-3 Patrick Mochel
  * Copyright (c) 2002-3 Open Source Development Labs
@@ -14,8 +14,8 @@
 #include <linux/module.h>
 #include <linux/init.h>
 
-struct device legacy_bus = {
-	.bus_id		= "legacy",
+struct device platform_bus = {
+	.bus_id		= "platform",
 };
 
 /**
@@ -29,7 +29,7 @@
 		return -EINVAL;
 
 	if (!pdev->dev.parent)
-		pdev->dev.parent = &legacy_bus;
+		pdev->dev.parent = &platform_bus;
 
 	pdev->dev.bus = &platform_bus_type;
 	
@@ -105,11 +105,11 @@
 
 int __init platform_bus_init(void)
 {
-	device_register(&legacy_bus);
+	device_register(&platform_bus);
 	return bus_register(&platform_bus_type);
 }
 
-EXPORT_SYMBOL(legacy_bus);
+EXPORT_SYMBOL(platform_bus);
 EXPORT_SYMBOL(platform_bus_type);
 EXPORT_SYMBOL(platform_device_register);
 EXPORT_SYMBOL(platform_device_unregister);
diff -urN -X dontdiff linux-2.6.0-test9/drivers/i2c/i2c-core.c linux-2.6.0-test9-jeh1/drivers/i2c/i2c-core.c
--- linux-2.6.0-test9/drivers/i2c/i2c-core.c	2003-10-25 14:43:00.000000000 -0400
+++ linux-2.6.0-test9-jeh1/drivers/i2c/i2c-core.c	2003-10-28 13:04:41.000000000 -0500
@@ -136,10 +136,10 @@
 
 	/* Add the adapter to the driver core.
 	 * If the parent pointer is not set up,
-	 * we add this adapter to the legacy bus.
+	 * we add this adapter to the platform bus.
 	 */
 	if (adap->dev.parent == NULL)
-		adap->dev.parent = &legacy_bus;
+		adap->dev.parent = &platform_bus;
 	sprintf(adap->dev.bus_id, "i2c-%d", adap->nr);
 	adap->dev.driver = &i2c_adapter_driver;
 	adap->dev.release = &i2c_adapter_dev_release;
diff -urN -X dontdiff linux-2.6.0-test9/drivers/i2c/i2c-dev.c linux-2.6.0-test9-jeh1/drivers/i2c/i2c-dev.c
--- linux-2.6.0-test9/drivers/i2c/i2c-dev.c	2003-10-25 14:44:17.000000000 -0400
+++ linux-2.6.0-test9-jeh1/drivers/i2c/i2c-dev.c	2003-10-28 13:04:54.000000000 -0500
@@ -447,7 +447,7 @@
 
 	/* register this i2c device with the driver core */
 	i2c_dev->adap = adap;
-	if (adap->dev.parent == &legacy_bus)
+	if (adap->dev.parent == &platform_bus)
 		i2c_dev->class_dev.dev = &adap->dev;
 	else
 		i2c_dev->class_dev.dev = adap->dev.parent;
diff -urN -X dontdiff linux-2.6.0-test9/drivers/scsi/hosts.c linux-2.6.0-test9-jeh1/drivers/scsi/hosts.c
--- linux-2.6.0-test9/drivers/scsi/hosts.c	2003-10-25 14:42:51.000000000 -0400
+++ linux-2.6.0-test9-jeh1/drivers/scsi/hosts.c	2003-10-28 13:05:45.000000000 -0500
@@ -111,7 +111,7 @@
 	}
 
 	if (!shost->shost_gendev.parent)
-		shost->shost_gendev.parent = dev ? dev : &legacy_bus;
+		shost->shost_gendev.parent = dev ? dev : &platform_bus;
 
 	error = device_add(&shost->shost_gendev);
 	if (error)
diff -urN -X dontdiff linux-2.6.0-test9/include/linux/device.h linux-2.6.0-test9-jeh1/include/linux/device.h
--- linux-2.6.0-test9/include/linux/device.h	2003-10-25 14:44:42.000000000 -0400
+++ linux-2.6.0-test9-jeh1/include/linux/device.h	2003-10-28 13:06:04.000000000 -0500
@@ -372,7 +372,7 @@
 extern void platform_device_unregister(struct platform_device *);
 
 extern struct bus_type platform_bus_type;
-extern struct device legacy_bus;
+extern struct device platform_bus;
 
 /* drivers/base/power.c */
 extern void device_shutdown(void);

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

* Re: PATCH: rename legacy bus to platform bus
  2003-10-28 18:12   ` Jamey Hicks
@ 2003-10-28 18:24     ` Patrick Mochel
  0 siblings, 0 replies; 5+ messages in thread
From: Patrick Mochel @ 2003-10-28 18:24 UTC (permalink / raw)
  To: Jamey Hicks; +Cc: linux-kernel


> Regenerated from a cleanly modified 2.6.0-test9 tree.

Applied, thanks.


	Pat


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

end of thread, other threads:[~2003-10-28 18:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-23 15:11 PATCH: rename legacy bus to platform bus Jamey Hicks
2003-10-24  6:51 ` H. Peter Anvin
2003-10-27 22:46 ` Patrick Mochel
2003-10-28 18:12   ` Jamey Hicks
2003-10-28 18:24     ` Patrick Mochel

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