aboutsummaryrefslogtreecommitdiffstats
path: root/driver
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2006-06-16 14:32:17 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2006-06-16 14:32:17 -0700
commit3ab23ec21bc7eb5f1cc934b7c8ab126d01dd3f51 (patch)
tree7f6c1a90c2f9d00aeb63ae8d052c273285f1b139 /driver
parent57be4f6350e7b3b994cc39b175c4090b965c90d3 (diff)
downloadpatches-3ab23ec21bc7eb5f1cc934b7c8ab126d01dd3f51.tar.gz
new dev_printk() patch
Diffstat (limited to 'driver')
-rw-r--r--driver/dev_printk_add_bus.patch29
-rw-r--r--driver/driver-core-make-dev_info-and-friends-print-the-bus-name-if-there-is-no-driver.patch60
-rw-r--r--driver/put_device-might_sleep.patch2
3 files changed, 61 insertions, 30 deletions
diff --git a/driver/dev_printk_add_bus.patch b/driver/dev_printk_add_bus.patch
deleted file mode 100644
index 6879f88a73ad2..0000000000000
--- a/driver/dev_printk_add_bus.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From foo@baz Tue Apr 9 12:12:43 2002
-Date: Thu, 15 Jun 2006 08:44:32 -0700
-To: Greg KH <greg@kroah.com>
-From: Greg Kroah-Hartman <gregkh@suse.de>
-Subject: Driver core: make dev_printk() print the bus name if no driver is bound
-
-This should make the output a bit more readable when devices have not
-been bound to a driver yet.
-
-Cc: Alan Stern <stern@rowland.harvard.edu>
-Cc: Matthew Wilcox <matthew@wil.cx>
-Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-
----
- include/linux/device.h | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
---- gregkh-2.6.orig/include/linux/device.h
-+++ gregkh-2.6/include/linux/device.h
-@@ -418,7 +418,8 @@ extern void firmware_unregister(struct s
-
- /* debugging and troubleshooting/diagnostic helpers. */
- #define dev_printk(level, dev, format, arg...) \
-- printk(level "%s %s: " format , (dev)->driver ? (dev)->driver->name : "" , (dev)->bus_id , ## arg)
-+ printk(level "%s %s: " format , (dev)->driver ? (dev)->driver->name : \
-+ (dev)->bus ? (dev)->bus->name : "" , (dev)->bus_id , ## arg)
-
- #ifdef DEBUG
- #define dev_dbg(dev, format, arg...) \
diff --git a/driver/driver-core-make-dev_info-and-friends-print-the-bus-name-if-there-is-no-driver.patch b/driver/driver-core-make-dev_info-and-friends-print-the-bus-name-if-there-is-no-driver.patch
new file mode 100644
index 0000000000000..8c7c43e7fb6d8
--- /dev/null
+++ b/driver/driver-core-make-dev_info-and-friends-print-the-bus-name-if-there-is-no-driver.patch
@@ -0,0 +1,60 @@
+From stern@rowland.harvard.edu Fri Jun 16 14:11:07 2006
+Date: Fri, 16 Jun 2006 17:10:48 -0400 (EDT)
+From: Alan Stern <stern@rowland.harvard.edu>
+To: Greg KH <greg@kroah.com>
+Subject: Driver Core: Make dev_info and friends print the bus name if there is no driver
+Message-ID: <Pine.LNX.4.44L0.0606161704460.6004-100000@iolanthe.rowland.org>
+
+This patch (as721) makes dev_info and related macros print the device's
+bus name if the device doesn't have a driver, instead of printing just a
+blank. If the device isn't on a bus either... well, then it does leave
+a blank space. But it will be easier for someone else to change if they
+want.
+
+Cc: Matthew Wilcox <matthew@wil.cx>
+Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/base/core.c | 16 ++++++++++++++++
+ include/linux/device.h | 3 ++-
+ 2 files changed, 18 insertions(+), 1 deletion(-)
+
+--- gregkh-2.6.orig/drivers/base/core.c
++++ gregkh-2.6/drivers/base/core.c
+@@ -29,6 +29,22 @@ int (*platform_notify_remove)(struct dev
+ * sysfs bindings for devices.
+ */
+
++/**
++ * dev_driver_string - Return a device's driver name, if at all possible
++ * @dev: struct device to get the name of
++ *
++ * Will return the device's driver's name if it is bound to a device. If
++ * the device is not bound to a device, it will return the name of the bus
++ * it is attached to. If it is not attached to a bus either, an empty
++ * string will be returned.
++ */
++const char *dev_driver_string(struct device *dev)
++{
++ return dev->driver ? dev->driver->name :
++ (dev->bus ? dev->bus->name : "");
++}
++EXPORT_SYMBOL_GPL(dev_driver_string);
++
+ #define to_dev(obj) container_of(obj, struct device, kobj)
+ #define to_dev_attr(_attr) container_of(_attr, struct device_attribute, attr)
+
+--- gregkh-2.6.orig/include/linux/device.h
++++ gregkh-2.6/include/linux/device.h
+@@ -417,8 +417,9 @@ extern int firmware_register(struct subs
+ extern void firmware_unregister(struct subsystem *);
+
+ /* debugging and troubleshooting/diagnostic helpers. */
++extern const char *dev_driver_string(struct device *dev);
+ #define dev_printk(level, dev, format, arg...) \
+- printk(level "%s %s: " format , (dev)->driver ? (dev)->driver->name : "" , (dev)->bus_id , ## arg)
++ printk(level "%s %s: " format , dev_driver_string(dev) , (dev)->bus_id , ## arg)
+
+ #ifdef DEBUG
+ #define dev_dbg(dev, format, arg...) \
diff --git a/driver/put_device-might_sleep.patch b/driver/put_device-might_sleep.patch
index c4a7861dcbe9d..78871aa10c2f0 100644
--- a/driver/put_device-might_sleep.patch
+++ b/driver/put_device-might_sleep.patch
@@ -12,7 +12,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
--- gregkh-2.6.orig/drivers/base/core.c
+++ gregkh-2.6/drivers/base/core.c
-@@ -395,6 +395,7 @@ struct device * get_device(struct device
+@@ -411,6 +411,7 @@ struct device * get_device(struct device
*/
void put_device(struct device * dev)
{