Commit:     a456b7023e0abf80bb03b0bdf5471b48878e5c49
Parent:     864062457a2e444227bd368ca5f2a2b740de604f
Author:     Jean Delvare <[EMAIL PROTECTED]>
AuthorDate: Fri Mar 9 16:33:10 2007 +0100
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 10:57:28 2007 -0700

    dev_printk and new-style class devices
    As the new-style class devices (as opposed to old-style struct
    class_device) are becoming more widely used, I noticed that the
    dev_printk-based functions are not working properly with these.
    New-style class devices have no driver nor bus, almost by definition,
    and as a result dev_driver_string(), which is used as the first
    parameter of dev_printk, resolves to an empty string. This causes
    entries like the following to show in my logs:
     i2c-2: adapter [SMBus stub driver] registered
    Notice the unaesthetical leading whitespace. In order to fix this
    problem, I suggest that we extend dev_driver_string to deal with
    new-style class devices:
    Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
 drivers/base/core.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index 658eae5..9ea12d9 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -43,7 +43,8 @@ int (*platform_notify_remove)(struct device * dev) = NULL;
 const char *dev_driver_string(struct device *dev)
        return dev->driver ? dev->driver->name :
-                       (dev->bus ? dev->bus->name : "");
+                       (dev->bus ? dev->bus->name :
+                       (dev->class ? dev->class->name : ""));
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to