aboutsummaryrefslogtreecommitdiffstats
path: root/driver
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2005-12-13 12:04:03 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2005-12-13 12:04:03 -0800
commit1d73f8fce5c1442af64cb5de4056420a2728f396 (patch)
tree6cafd2711c2bfa5a6b23ec075887bdd310284a4d /driver
parenteff9e116197faa36249e2d68a76342cd380288b1 (diff)
downloadpatches-1d73f8fce5c1442af64cb5de4056420a2728f396.tar.gz
pci and driver core patches
Diffstat (limited to 'driver')
-rw-r--r--driver/input-fix-add-modalias-support-build-error.patch38
-rw-r--r--driver/platform-device-del.patch106
-rw-r--r--driver/platform-rearange-exports.patch118
3 files changed, 262 insertions, 0 deletions
diff --git a/driver/input-fix-add-modalias-support-build-error.patch b/driver/input-fix-add-modalias-support-build-error.patch
new file mode 100644
index 0000000000000..7037f5471b4db
--- /dev/null
+++ b/driver/input-fix-add-modalias-support-build-error.patch
@@ -0,0 +1,38 @@
+From rusty@rustcorp.com.au Sat Dec 10 03:52:45 2005
+From: Rusty Russell <rusty@rustcorp.com.au>
+Subject: Input: fix add modalias support build error
+To: Andrew Morton <akpm@osdl.org>
+Cc: Greg KH <greg@kroah.com>
+Date: Sat, 10 Dec 2005 22:48:20 +1100
+Message-Id: <1134215301.30143.15.camel@localhost.localdomain>
+
+Fix build when scripts/mod/file2alias.c includes linux/input.h, which
+tries to include /usr/include/linux/mod_devicetable.h:
+
+ In file included from scripts/mod/file2alias.c:40:
+ include/linux/input.h:21:35: linux/mod_devicetable.h: No such file or directory
+ make[2]: *** [scripts/mod/file2alias.o] Error 1
+
+Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ include/linux/input.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- gregkh-2.6.orig/include/linux/input.h
++++ gregkh-2.6/include/linux/input.h
+@@ -13,12 +13,12 @@
+ #include <linux/time.h>
+ #include <linux/list.h>
+ #include <linux/device.h>
++#include <linux/mod_devicetable.h>
+ #else
+ #include <sys/time.h>
+ #include <sys/ioctl.h>
+ #include <asm/types.h>
+ #endif
+-#include <linux/mod_devicetable.h>
+
+ /*
+ * The event structure itself
diff --git a/driver/platform-device-del.patch b/driver/platform-device-del.patch
new file mode 100644
index 0000000000000..de62f234b5534
--- /dev/null
+++ b/driver/platform-device-del.patch
@@ -0,0 +1,106 @@
+From dtor_core@ameritech.net Fri Dec 9 22:55:02 2005
+Message-Id: <20051210064750.775640000.dtor_core@ameritech.net>
+Date: Sat, 10 Dec 2005 01:36:27 -0500
+From: Dmitry Torokhov <dtor_core@ameritech.net>
+To: Greg KH <greg@kroah.com>
+Cc: Russell King <rmk+lkml@arm.linux.org.uk>, Jean Delvare <khali@linux-fr.org>
+Subject: Driver Core: Add platform_device_del()
+Content-Disposition: inline; filename=platform-device-del.patch
+
+Driver core: add platform_device_del function
+
+Having platform_device_del90 allows more straightforward error
+handling code in drivers registering platform devices.
+
+Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/base/platform.c | 45 ++++++++++++++++++++++++++--------------
+ include/linux/platform_device.h | 1
+ 2 files changed, 31 insertions(+), 15 deletions(-)
+
+--- gregkh-2.6.orig/drivers/base/platform.c
++++ gregkh-2.6/drivers/base/platform.c
+@@ -168,7 +168,7 @@ struct platform_device *platform_device_
+ pa->pdev.dev.release = platform_device_release;
+ }
+
+- return pa ? &pa->pdev : NULL;
++ return pa ? &pa->pdev : NULL;
+ }
+ EXPORT_SYMBOL_GPL(platform_device_alloc);
+
+@@ -282,24 +282,13 @@ int platform_device_add(struct platform_
+ EXPORT_SYMBOL_GPL(platform_device_add);
+
+ /**
+- * platform_device_register - add a platform-level device
+- * @pdev: platform device we're adding
+- *
+- */
+-int platform_device_register(struct platform_device * pdev)
+-{
+- device_initialize(&pdev->dev);
+- return platform_device_add(pdev);
+-}
+-
+-/**
+- * platform_device_unregister - remove a platform-level device
++ * platform_device_del - remove a platform-level device
+ * @pdev: platform device we're removing
+ *
+ * Note that this function will also release all memory- and port-based
+ * resources owned by the device (@dev->resource).
+ */
+-void platform_device_unregister(struct platform_device * pdev)
++void platform_device_del(struct platform_device *pdev)
+ {
+ int i;
+
+@@ -310,9 +299,35 @@ void platform_device_unregister(struct p
+ release_resource(r);
+ }
+
+- device_unregister(&pdev->dev);
++ device_del(&pdev->dev);
+ }
+ }
++EXPORT_SYMBOL_GPL(platform_device_del);
++
++/**
++ * platform_device_register - add a platform-level device
++ * @pdev: platform device we're adding
++ *
++ */
++int platform_device_register(struct platform_device * pdev)
++{
++ device_initialize(&pdev->dev);
++ return platform_device_add(pdev);
++}
++
++/**
++ * platform_device_unregister - unregister a platform-level device
++ * @pdev: platform device we're unregistering
++ *
++ * Unregistration is done in 2 steps. Fisrt we release all resources
++ * and remove it from the sybsystem, then we drop reference count by
++ * calling platform_device_put().
++ */
++void platform_device_unregister(struct platform_device * pdev)
++{
++ platform_device_del(pdev);
++ platform_device_put(pdev);
++}
+
+ /**
+ * platform_device_register_simple
+--- gregkh-2.6.orig/include/linux/platform_device.h
++++ gregkh-2.6/include/linux/platform_device.h
+@@ -41,6 +41,7 @@ extern struct platform_device *platform_
+ extern int platform_device_add_resources(struct platform_device *pdev, struct resource *res, unsigned int num);
+ extern int platform_device_add_data(struct platform_device *pdev, void *data, size_t size);
+ extern int platform_device_add(struct platform_device *pdev);
++extern void platform_device_del(struct platform_device *pdev);
+ extern void platform_device_put(struct platform_device *pdev);
+
+ struct platform_driver {
diff --git a/driver/platform-rearange-exports.patch b/driver/platform-rearange-exports.patch
new file mode 100644
index 0000000000000..c02bb88ba024b
--- /dev/null
+++ b/driver/platform-rearange-exports.patch
@@ -0,0 +1,118 @@
+From dtor_core@ameritech.net Fri Dec 9 22:54:49 2005
+Message-Id: <20051210064750.889604000.dtor_core@ameritech.net>
+Date: Sat, 10 Dec 2005 01:36:28 -0500
+From: Dmitry Torokhov <dtor_core@ameritech.net>
+To: Greg KH <greg@kroah.com>
+Cc: Russell King <rmk+lkml@arm.linux.org.uk>, Jean Delvare <khali@linux-fr.org>
+Subject: Driver Core: Rearrange exports in platform.c
+Content-Disposition: inline; filename=platform-rearange-exports.patch
+
+Driver core: rearrange exports in platform.c
+
+The new way is to specify export right after symbol definition.
+Rearrange exports to follow new style to avoid mixing two styles
+in one file.
+
+Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/base/platform.c | 21 ++++++++++-----------
+ 1 file changed, 10 insertions(+), 11 deletions(-)
+
+--- gregkh-2.6.orig/drivers/base/platform.c
++++ gregkh-2.6/drivers/base/platform.c
+@@ -25,6 +25,7 @@
+ struct device platform_bus = {
+ .bus_id = "platform",
+ };
++EXPORT_SYMBOL_GPL(platform_bus);
+
+ /**
+ * platform_get_resource - get a resource for a device
+@@ -49,6 +50,7 @@ platform_get_resource(struct platform_de
+ }
+ return NULL;
+ }
++EXPORT_SYMBOL_GPL(platform_get_resource);
+
+ /**
+ * platform_get_irq - get an IRQ for a device
+@@ -61,6 +63,7 @@ int platform_get_irq(struct platform_dev
+
+ return r ? r->start : 0;
+ }
++EXPORT_SYMBOL_GPL(platform_get_irq);
+
+ /**
+ * platform_get_resource_byname - get a resource for a device by name
+@@ -84,6 +87,7 @@ platform_get_resource_byname(struct plat
+ }
+ return NULL;
+ }
++EXPORT_SYMBOL_GPL(platform_get_resource_byname);
+
+ /**
+ * platform_get_irq - get an IRQ for a device
+@@ -96,6 +100,7 @@ int platform_get_irq_byname(struct platf
+
+ return r ? r->start : 0;
+ }
++EXPORT_SYMBOL_GPL(platform_get_irq_byname);
+
+ /**
+ * platform_add_devices - add a numbers of platform devices
+@@ -117,6 +122,7 @@ int platform_add_devices(struct platform
+
+ return ret;
+ }
++EXPORT_SYMBOL_GPL(platform_add_devices);
+
+ struct platform_object {
+ struct platform_device pdev;
+@@ -314,6 +320,7 @@ int platform_device_register(struct plat
+ device_initialize(&pdev->dev);
+ return platform_device_add(pdev);
+ }
++EXPORT_SYMBOL_GPL(platform_device_register);
+
+ /**
+ * platform_device_unregister - unregister a platform-level device
+@@ -328,6 +335,7 @@ void platform_device_unregister(struct p
+ platform_device_del(pdev);
+ platform_device_put(pdev);
+ }
++EXPORT_SYMBOL_GPL(platform_device_unregister);
+
+ /**
+ * platform_device_register_simple
+@@ -370,6 +378,7 @@ error:
+ platform_device_put(pdev);
+ return ERR_PTR(retval);
+ }
++EXPORT_SYMBOL_GPL(platform_device_register_simple);
+
+ static int platform_drv_probe(struct device *_dev)
+ {
+@@ -491,6 +500,7 @@ struct bus_type platform_bus_type = {
+ .suspend = platform_suspend,
+ .resume = platform_resume,
+ };
++EXPORT_SYMBOL_GPL(platform_bus_type);
+
+ int __init platform_bus_init(void)
+ {
+@@ -519,14 +529,3 @@ u64 dma_get_required_mask(struct device
+ }
+ EXPORT_SYMBOL_GPL(dma_get_required_mask);
+ #endif
+-
+-EXPORT_SYMBOL_GPL(platform_bus);
+-EXPORT_SYMBOL_GPL(platform_bus_type);
+-EXPORT_SYMBOL_GPL(platform_add_devices);
+-EXPORT_SYMBOL_GPL(platform_device_register);
+-EXPORT_SYMBOL_GPL(platform_device_register_simple);
+-EXPORT_SYMBOL_GPL(platform_device_unregister);
+-EXPORT_SYMBOL_GPL(platform_get_irq);
+-EXPORT_SYMBOL_GPL(platform_get_resource);
+-EXPORT_SYMBOL_GPL(platform_get_irq_byname);
+-EXPORT_SYMBOL_GPL(platform_get_resource_byname);